here from my master page hiiden field i am gettin开发者_运维知识库g the value in Sessioninfo
now in child page i have another hidden field called hfchildpage now i need to assign the Sessioninfo. value to hfchildpage
can u plz provide the syntax for it thank you
Hope I understood what you mean... Set the hidden input the id attribute of hfchildpage and use the following:
document.getElementById('hfchildpage').value = **the value you want**
It really depends where your control is situated in your page. FindControl method will not simply find a control anywhere. i.e. It the control may not be found if the control is nested within another control, one needs to step down through the control structure.
However if the resulting element is named 'ct100_hfchildpage' then this bastardized javascript may do what you are looking for.
var hfchildpageElement = $get('<%=((Hiddenfield)this.Master.FindControl("ct100_hfchildpage")).ClientID %>');
if(hfchildpageElement) hfchildpageElement.value = 'whatEverYouWant';
That said, I think you should review your code and method of using sessions. Sessions are available server side, they are held server side, and hence not only is it very unusual to be storing and using them via JavaScript on the client side, it is bad practice and may be extremely insecure.
精彩评论