how to get value of hidden field value?
I have an asp.net application in which i want to get the value of hidden field value in to my code behind page.
Actually its executing code first and after that its executing javascript.
That's why i am not getting the value. Please tell me how can i get the value.
开发者_如何学运维Javascript
function changeCSS(colr,wd)
{
chooseStyle(colr, wd)
var CssTitle = document.getElementById('<%= hdCssTitle.ClientID %>');
CssTitle.value = colr;
}
and code behind page is
protected void Page_Load(object sender, EventArgs e)
{
string CssTitle = hdCssTitle.Value;
}
Values changed in Javascript won't be reflected in your server side script. You would have to make an Ajax post to your code-behind to obtain it.
Get hidden field and access that value like this string s = hidden.Text
精彩评论