Hi,
I have a WARP and few controls within it. I am creating HiddenFields dynamically on "click" of a button which is presrnt within the WARP.Code behind which creates the Hidden field is as follows.
{
hiddenField.ID = hiddenVariableName;
hiddenField.Value = hiddenVariableValue;
}
The hidden field values is to be read in the Client side.
var hidden = document.getElementById("HIDDENFIELD1")..
the variable hidden always return a null.
This is because the hidden variables created from the server side are not getting rendered at the client side as a partial post back and not a full postback is taking place because of WARP.
Could you please help me to fix this issue is there anyway to render this hiddenField onto the client side ?
I cant change the logic as this implementation is done for a specific reason.
Thanks in Advance..
-Nuthan
Hi Nuthan,
You can also change your code-behind and add the hiddenField to the controls collection of the WARP panel, instead of adding it to the controls collection of the Form control. Thus you will get working code, but be careful: If you awlays set the same ID for the hidden control on your ClickHandler you will get only one Hidden control rendered to the client !
Hello Nuthan,
I believe I know what is going on - WARP takes care of updating contents only within its tags, so if you create a new hidden and append it to the form, it will not be update upon WARP Refresh Request.
The solution could be to place
<igmisc:webasyncrefreshpanel ...
<asp:hiddenfield runat="server" ID="HiddenField1" ... />
</igmisc>
and you can update the internal to WARP hidden and access its value in the RefreshComplete client-side event (fired when WARP finishes its update)