开发者

how to get value of hidden field value?

开发者 https://www.devze.com 2022-12-09 19:44 出处:网络
I have an asp.net application in which i want to get the value of hidden field value in to my code behind page.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消