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 documented somewhere?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.