I am a beginner to .NET, I have some doubts in my mind. Can anybody help me to sort out?
-
When a user requests for a file(*.ASPX), The request first goes to IIS server and with the help of Handlers and modules it finds the type of file that need to be processed and sent back to the client. But while displaying on the cilent machine the content of the .ASPX file will be displayed as HTML controls. How are the events generated at the client side and sent back to the server?
-
I know runat=server tells the control will be processed at serverside.
But every time why we need to write “runat=server”. Is there any ASP.NET control which runs at client side?
if you are starting with .NET web development, ASP.NET MVC is the way to go IMO
an ASP.NET server control that is generating client events in the browser is exercising standard dom events via javascript code that gets injected into the page that is sent from the web server. try view page source from any browser to see what is actually generated and the picture will become more clear.
essentially runat=server is telling the ASP.NET parser to process the tag and generate some special HTML output for the page. see GvS’s explanation in this thread of how client events for these controls are converted to a form POST that is handled on the server.