R
Rock
How do I get a value of a textbox control from a form?
On form1, I have a textbox with the value "CountyID" with a submit button;
when the user clicks on Submit, it goes to Form2.
How do I get the value of "countyID" (or whatever the user enters into the
textbox) to display on form2?
Something like request.Params("???"). request.Form????
Request Two:
If I put the forms into user controls, what would I do to get the
information the user has selected? This is what I've tried:
default.aspx has 2 controls: Ctrl1 and Ctrl2.
Ctrl1 has a drop down list, say ddlCounty
ddlCounty.SelectedItemChanged raises a public event
SelectedItemChanged, with a ReadOnly property SelectedItem, which returns
ddlCounty.SelectedItem
Public ReadOnly Property SelectedItem() As
ListItem
Get
Return ddlCounty.SelectedItem
End Get
End Property
Ctrl2 on postback tries to read the selectedItem property
from Ctrl1:
Dim x As New ctrl1
Response.Write(x.SelectedItem)
When run, I get this error:
Exception details: Object Reference Not Set to an instance of an object
Source Error:
Line 66: Public ReadOnly Property SelectedItem() As ListItem
Line 67: Get
Line 68: Return ddlCounty.SelectedItem
Line 69: End Get
Line 70: End Property
Thanks.
On form1, I have a textbox with the value "CountyID" with a submit button;
when the user clicks on Submit, it goes to Form2.
How do I get the value of "countyID" (or whatever the user enters into the
textbox) to display on form2?
Something like request.Params("???"). request.Form????
Request Two:
If I put the forms into user controls, what would I do to get the
information the user has selected? This is what I've tried:
default.aspx has 2 controls: Ctrl1 and Ctrl2.
Ctrl1 has a drop down list, say ddlCounty
ddlCounty.SelectedItemChanged raises a public event
SelectedItemChanged, with a ReadOnly property SelectedItem, which returns
ddlCounty.SelectedItem
Public ReadOnly Property SelectedItem() As
ListItem
Get
Return ddlCounty.SelectedItem
End Get
End Property
Ctrl2 on postback tries to read the selectedItem property
from Ctrl1:
Dim x As New ctrl1
Response.Write(x.SelectedItem)
When run, I get this error:
Exception details: Object Reference Not Set to an instance of an object
Source Error:
Line 66: Public ReadOnly Property SelectedItem() As ListItem
Line 67: Get
Line 68: Return ddlCounty.SelectedItem
Line 69: End Get
Line 70: End Property
Thanks.