473,625 Members | 3,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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.ReferenceCe nter_Main_aspx 16608 56
ImageJavascript ASP.EmployerSer vicesJS_ascx 1643 0
ImageJavascript :_ctl0
System.Web.UI.R esourceBasedLit eralControl 1643 0
Form1 System.Web.UI.H tmlControls.Htm lForm 14260 0
TopGreenMenu ASP.TopGreenMen u_ascx 2351 0
TopGreenMenu:La bel1 System.Web.UI.W ebControls.Labe l 2349 0
TopGreenMenu:_c tl0 System.Web.UI.L iteralControl 2 0
SearchMenu ASP.SearchMenu_ ascx 659 0
SearchMenu:_ctl 0 System.Web.UI.L iteralControl 190 0
SearchMenu:Sear chBox System.Web.UI.W ebControls.Text Box 176
96
SearchMenu:_ctl 1 System.Web.UI.L iteralControl 5 0
SearchMenu:Sear chButton
System.Web.UI.W ebControls.Imag eButton 263 196
SearchMenu:_ctl 2 System.Web.UI.L iteralControl 25 0
TopOrangeMenu ASP.TopOrangeMe nu_ascx 2637 0
TopOrangeMenu:L abel1 System.Web.UI.W ebControls.Labe l 2537
0
>>>>>>>>>>>>>>> >>>TopOrangeMen u:txtU
System.Web.UI.H tmlControls.Htm lInputHidden 98 0
TopOrangeMenu:_ ctl0

I System.Web.UI.L iteralControl 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.EventArg s) Handles MyBase.PreRende r

dim str as string

str = Request.Form("t xtU")

str = Request.Form("T opOrangeMenu:tx tU")

str = Request.Form("T opOrangeMenu_tx tU")

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

str = MyBase.Request. Form("TopOrange Menu:txtU")

str = MyBase.Request. Form("TopOrange Menu_txtU")

str = Page.Request.Fo rm("txtU")

str = Page.Request.Fo rm("TopOrangeMe nu:txtU")

str = Page.Request.Fo rm("TopOrangeMe nu_txtU")
End If

End Sub


Thanks for any help!
Ron
Apr 10 '07 #1
1 3437
On Apr 10, 8:59 pm, "RSH" <way_beyond_o.. .@yahoo.comwrot e:
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:HiddenFiel d
Then you can do this:
Dim h as HiddenField = CType(Page.Find Control("idOfMy HiddenField"),
HiddenField)

..t

--
http://ajaxwidgets.com
ASP.NET 2.0 Ajax Widgets

Apr 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1380
by: John Ninan | last post by:
In my aspx Page i have asp.net combobox. It has different values. So i am generating usercontrol based on that. For example i have different flight leg in my combobox. I select first flight leg , it populate usercontrol times 6 because it has 6 passenger. Second time i select 2nd flight leg it has 2 usercontorl. The usercontrol will populate correctly. But the value inside usercontrl is not changing. I try to debug it . It seems, it is...
3
3122
by: webserverpete | last post by:
I am new to ASP.NET in general, but I do have experience with classic ASP. I am using a DataList control with a hidden value to submit to a different page, however I do not know how to get to that hidden value. Here is my DataList control code: <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1" RepeatColumns="4"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "itemname")%> <br>...
3
1966
by: sklett | last post by:
I've added a HiddenField control to my page and some javascript to show it's value in an alert box when a button is pressed. The value that is displayed in the alert box is correct, but when I post the form the value for the HiddenField control is empty. I'm pretty new to ASP.net so I'm not really sure what could cause this. I'm using client side javascript to set the value in the HiddenField, not sure if that matters.
3
6848
by: Jeff | last post by:
Hey ASP.NET 2.0 Below you see the code I'm having problem with. In the Open_Message event/method I want to get the value of the HiddenField at the row in the repeater control I clicked.... my goal is to get the id (not a control Id, but an id related to a database record) of a row in the repeater control. I don't want to use Get... I've tryed to use e.FindControl in the Open_message event but FindControl isn't available, so I don't...
4
4571
by: bushi | last post by:
hi ! i have following code to display some text on a web form,after getting it from database. <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1"> <ItemTemplate> <asp:LinkButton ID="links" runat="server" Text='<%# Eval("links") %>' OnClick="LinkButton1_Click"></asp:LinkButton><br />
3
1376
by: KBTibbs | last post by:
I've got an ASP.NET page that's doing some moderate data calculations based on user input. I've got a button that onclick runs a javascript function to pop open a new window and display the data I want it to have. After hacking my way through several strange problems, I've got it working for the most part. I'm down to only one problem: The <asp:hiddenfield> I'm using gets updated as a result of the calculations I'm doing server side, but...
0
2371
by: DJOuk | last post by:
Posted this on Asp.Net, seems to be a hard problem, I still can't work it out I have a edit button, this works fine, until I add the code that prevents the edit button from being seen by users who did not post that ticket. I cannot understand why this is happening. I get an error on the button says 'object reference not set in instance of object' It happens when I add the following code:
7
11502
by: imbirek8 | last post by:
Hi! I would like to write something in Javascript to HiddenField: <asp:HiddenField ID="hiddenMy" runat="server" Value="" /> And in the code behind read this value. But this HiddenField is in user control. I use this control in many pages and in every page this field has different value.. I don't know why, but it's error when I do: var hidden = document.GetElementById('<%= this.gvClient.ClientID %>');
0
1048
by: loginarpit | last post by:
I am dynamically creating a row of elements including a HiddenField. In a client-side function I am updating the value of this HiddenField. its ok till now. Now a button click causes a postback and the row of dynamically created elements ( including a HiddenField) is recreated. But the value of HiddenField is not restored as it is restored by viewstate, when updated in server-side code. How can I persist the javascript-updated value of...
0
8694
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8635
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8497
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6118
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4089
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1500
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.