In ASP.NET 2.0, you shoud use the functions placed in Page.ClientScript to
register scripts or hidden fields in the page. In the previous version of
ASP.NET theses functions where placed directly on the Page object.
In your example, you can use the folowing statement to register your hidden
field from a UserControl, the Page or from the MasterPage. The client ID of
the field will be preserved with this method :)
Page.ClientScript.RegisterHiddenField("MyHiddenFie ld", "default value");
--
Daniel TIZON
MCP - MCSD.NET - MCT
"David Jessee" <Da*********@discussions.microsoft.com> a écrit dans le
message de news:
32**********************************@microsoft.com...
Have you tried dynamicly generating your script, using the ClientId
property
of the controls to get the ids for the hidden fields?
"Stu" wrote:
Hi,
I am migrating a large app to .Net 2 and am having problems with
accessing
hidden fields using javascript.
As I am using masterpages the control names are prefixed with the control
reference of the masterpage '_ctl0_cphMain_MyHiddenField' etc. The app
uses
dynamically assigned masterpages to the control name on the page changes
depending on the masterpage being used. There is no
Is there any way of specifying a clientside name to a hidden field, or
adding the additional string to the script automatically?
Thanks in advance,
Stu