0

My Try 1:

var a=confirm('Do You Really want to Save this Record?') ;
document.getElementById('Hidden.ClientID') = a;

My Try 2:

var a=confirm('Do You Really want to Save this Record?') ;
document.getElementById('Hidden.ClientID').value = a;

Code Behind :

Response.Write(Hidden.Value);
Response.End();

////////// Why Value is Not getting stored in Hidden Field?

KV Prajapati
  • 93,659
  • 19
  • 148
  • 186
VaruN
  • 1

2 Answers2

2

Try,

var ele=document.getElementById('<%=Hidden.ClientID%>');
ele.value=a;
KV Prajapati
  • 93,659
  • 19
  • 148
  • 186
  • The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). – VaruN Jul 13 '12 at 10:30
  • Ok.. Error GOne.. but Still Value not getting Stored.. Shows me Blank Value as its "" at Design time – VaruN Jul 13 '12 at 10:36
2

Working Code see

document.getElementById('<%=Hidden.ClientID%>').value="a";

    Code Behind :        
    Response.Write(Hidden.Value);
    Response.End();
Nikhil D
  • 2,479
  • 3
  • 21
  • 41