The Controls collection cannot be modified because the control contains code blocks (i.e. <% … %>).
we need to access the c# variable in .aspx page at the time we have problem
Please guide us?
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.
It would help if you gave more detail about what you’re trying to do, however you can try this:
First make any variables you want to access in your
aspxmarkupprotected.Then in the page_load method, call
DataBind();Then in your markup you can do this:
The “
<%=” sequence can only be used within certain contexts in server controls. The sequence “<%#” is for DataBound controls and can be used in any context in ASPX page markup. CallingDataBind();allows you to use this (almost) anywhere on the page.