Hi all. I have a query that hit my mind when I was adding an asp.net web page in a project. Normally we place the server side code in the codebehind file. Could there be any improvement in the server side processing if we place both the code and the page design markup in the same page? I am referring to the practice like this:
<div>
<%if (ViewState["user-id"] != null)
{%>
<div>Hi, You are welcome.</div>
<%}
else
{%>
<div>Hi, please login or register.</div>
<%} %>
</div>
If we use separate codebehind file, we would do all these in the page load event and make div elements visible, invisible according to the test. We could even have only one div in the design page and set its inner text accordingly. Any suggestions?