When don’t you need to use runat="server" in ASP.NET?
EDIT: Thanks for all the answers, but I was really thinking of runat="server" inside an <asp: tag.
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.
Use the
runat=serverattribute when you’re using ASP.NET controls, and/or you require programmatic access to those controls in your code-behind.HTML controls don’t require this attribute. It’s useful if you have any HTML element like
<span><div>, or<table>when you want the ability to access them in code-behind.