greetings good experts.
In classic asp, I would pass values via hidden form or query string.
Can someone please show me how this is done in asp.net?
I am using vb.net version 2.0 and I am working with vs.2003
So far, anything I tried has failed.
I am trying to pass only 6 values from page1.aspx to page2.aspx. 2 of those values is checkboxList.
Here is an example of what I am trying to do.
In classic asp, I would pass values via hidden form or query string.
Can someone please show me how this is done in asp.net?
I am using vb.net version 2.0 and I am working with vs.2003
So far, anything I tried has failed.
I am trying to pass only 6 values from page1.aspx to page2.aspx. 2 of those values is checkboxList.
Here is an example of what I am trying to do.
Code:
Option Explicit On
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Xml
Imports System.Web
Imports System.Drawing
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.Page
Imports Microsoft.VisualBasic
Imports System.Web.HttpApplication
Imports System.Web.HttpResponse
Public Class _default
Inherits System.Web.UI.Page
Protected WithEvents txtAuthName As System.Web.UI.WebControls.TextBox
Protected WithEvents txtservice As System.Web.UI.WebControls.checkBoxList
Protected WithEvents txtcheck As System.Web.UI.WebControls.checkBoxList
Protected WithEvents txtAuthJob As System.Web.UI.WebControls.TextBox
Protected WithEvents txtAuthPhone As System.Web.UI.WebControls.TextBox
Protected WithEvents txtservice As System.Web.UI.WebControls.CheckBoxList
Protected WithEvents txtccCheck As System.Web.UI.WebControls.CheckBoxList
Protected WithEvents btnSave As System.Web.UI.WebControls.Button
Protected WithEvents txtAuthEmail As System.Web.UI.WebControls.TextBox
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents service As System.Web.UI.WebControls.CheckBoxList
Protected WithEvents ccCheck As System.Web.UI.WebControls.CheckBoxList
Protected WithEvents AuthName As System.Web.UI.WebControls.TextBox
Protected WithEvents AuthJob As System.Web.UI.WebControls.TextBox
Protected WithEvents AuthPhone As System.Web.UI.WebControls.TextBox
Protected WithEvents AuthEmail As System.Web.UI.WebControls.TextBox
Protected WithEvents submit As System.Web.UI.WebControls.Button
Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Me.txtAuthName.Text = Request.QueryString("AuthName")
Me.txtService.Text = Request.QueryString("cService")
Me.txtcCheck.Text = Request.QueryString("cCheck")
Me.txtAuthJob.Text = Request.QueryString("AuthJob")
Me.txtAuthPhone.Text = Request.QueryString("AuthPhone")
Me.txtAuthEmail.Text = Request.QueryString("AuthEmail")
End Sub
Private Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Response.Redirect("requesters.aspx?" + "&AuthName=" + Server.UrlEncode(Me.txtAuthName.Text)
+ "&cService=" + Server.UrlEncode(Me.txtCheck.Text)
+ "&cCheck=" + Server.UrlEncode(Me.txtAuthName.Text)
+ "&AuthJob=" + Server.UrlEncode(Me.txtAuthJob.Text) + "&AuthPhone=" + Server.UrlEncode(Me.txtAuthPhone.Text) + "&AuthEmail=" + Server.UrlEncode(Me.txtAuthEmail.Text))
End Sub
This is not working.
I am getting an error that the way I am doing checkboxlist is incorrect. Please. please help!
Thanks in advnance
End Class