开发者

Request.Form[MyControl.ClientID] is Null

I've noticed that, during a postback, Request.Form[MyControl.ClientID] is null. However, Request.Form[MyControl.Name] contains the expected value.

This is unexpected. Is this d开发者_高级运维ocumented somewhere?


This is correct - browser will use control's name (and not ID) for posting the values. Further, use Request.Form[MyControl.UniqueID] to get the value from POST data (because ASP.NET uses that value as control name in the generated html while ClientID is used as html id).

See W3C documentation that describes the form submission - check 17.13.2 & 17.13.3.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜