开发者

ASP.NET Partial Postback form value problem

开发者 https://www.devze.com 2023-03-13 06:57 出处:网络
In my page_load I am creating a HiddenField newField= new HiddenField(); and then I am assigning newField.ID = \"someid\" and Value=\"0\" to it.on a partial postback (triggered by an UpdatePanel)

In my page_load I am creating a

HiddenField newField= new HiddenField();

and then I am assigning newField.ID = "someid" and Value="0" to it. on a partial postback (triggered by an UpdatePanel) i am then checking

Request.Form["someid"]

in the panel_Load event during the postback. but the request returns null as someid wasn't posted back. (not contained in the Req开发者_开发技巧uest.Form collection) Why could this be?

Thanks


ASP.NET mangles the ID when rendered to the client by default. To access it from the Form collection, try this:

Request.Form[newField.ClientID]
0

精彩评论

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