Help getting at value of HiddenField in a UserControl (.Net 1.1)

R

RSH

I have a situation where I have a user control (Called TopOrangeMenu) that
has an Hidden HTML Field called "txtU"

I am trying to get at the value of that hidden field control from within the
User Control.

Hidden Field Control as it apears in the HTML of the User Control:
<INPUT id="txtU" type="hidden" runat="server">

Trace Output (partial) from the browser:
__PAGE ASP.ReferenceCenter_Main_aspx 16608 56
ImageJavascript ASP.EmployerServicesJS_ascx 1643 0
ImageJavascript:_ctl0
System.Web.UI.ResourceBasedLiteralControl 1643 0
Form1 System.Web.UI.HtmlControls.HtmlForm 14260 0
TopGreenMenu ASP.TopGreenMenu_ascx 2351 0
TopGreenMenu:Label1 System.Web.UI.WebControls.Label 2349 0
TopGreenMenu:_ctl0 System.Web.UI.LiteralControl 2 0
SearchMenu ASP.SearchMenu_ascx 659 0
SearchMenu:_ctl0 System.Web.UI.LiteralControl 190 0
SearchMenu:SearchBox System.Web.UI.WebControls.TextBox 176
96
SearchMenu:_ctl1 System.Web.UI.LiteralControl 5 0
SearchMenu:SearchButton
System.Web.UI.WebControls.ImageButton 263 196
SearchMenu:_ctl2 System.Web.UI.LiteralControl 25 0
TopOrangeMenu ASP.TopOrangeMenu_ascx 2637 0
TopOrangeMenu:Label1 System.Web.UI.WebControls.Label 2537
0System.Web.UI.HtmlControls.HtmlInputHidden 98 0
TopOrangeMenu:_ctl0

I System.Web.UI.LiteralControl 2 0
I have tried everything I can think of but the value is always
nothing:
Private Sub Page_PreRender(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.PreRender

dim str as string

str = Request.Form("txtU")

str = Request.Form("TopOrangeMenu:txtU")

str = Request.Form("TopOrangeMenu_txtU")

str = MyBase.Request.Form("txtU")

str = MyBase.Request.Form("TopOrangeMenu:txtU")

str = MyBase.Request.Form("TopOrangeMenu_txtU")

str = Page.Request.Form("txtU")

str = Page.Request.Form("TopOrangeMenu:txtU")

str = Page.Request.Form("TopOrangeMenu_txtU")


End If

End Sub




Thanks for any help!
Ron
 
T

Thomas Hansen

I have a situation where I have a user control (Called TopOrangeMenu) that
has an Hidden HTML Field called "txtU"

Don't use <input type="hidden" .....
Use <asp:HiddenField
Then you can do this:
Dim h as HiddenField = CType(Page.FindControl("idOfMyHiddenField"),
HiddenField)

..t
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top