Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / June 2006

Tip: Looking for answers? Try searching our database.

Easy question (i hope)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dave - 20 Jun 2006 01:18 GMT
I have built a custom control with a hidden html input box.  I use this
hidden field to hold a value that i wanted posted back to the server after
the click event of a page button.
Within this event, i am able to access the hidden field value through a
property in my custom control.  That seems to work ok.

The problem however, is that the value of this hidden field is not available
during the CreateChildControls of the custom control.  As a result after the
postback i am not able to store or use the posted value in the control while
it renders after the postback.  I have been pulling my hair out on this.  It
seems that it is a timing issue the control renders prior to the value being
available.

Where/how can i get the value of this hidden field prior to the control
running CreateChildControls?

any ideas?

while loading the control after the postback i need this value inside the
custom control.  It seems that the control is render and executes
CreateChildControls prior to the posted value (in the hidden field) is
availble to the control.
Steve C. Orr [MVP, MCSD] - 21 Jun 2006 19:38 GMT
The value should be available in the Forms collection.

MyVar = Request.Forms("MyHiddenField").ToString()

Signature

I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

>I have built a custom control with a hidden html input box.  I use this
> hidden field to hold a value that i wanted posted back to the server after
[quoted text clipped - 23 lines]
> CreateChildControls prior to the posted value (in the hidden field) is
> availble to the control.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.