Reputation: 12366
I'm developing an ASP.NET website. Sometimes some modules contain so few content that I present them inside a jQUeryUI dialog and communicate with the server via AJAX. I keep those contents inside a separate file and load them to a jQueryUI dialog according to the appropriate module.I was wondering if it's a good idea to have that content as a plain HTML elements instead of asp ones. Somehow I thought maybe this would reduce the overhead the conversion from asp elements to html elements can cause.
Upvotes: 0
Views: 375
Reputation: 66641
If you have aspx pages, or ascs user controls that you do not actually use/run any code, you can set the AutoEventWireup
the EnableViewState
, and maybe the EnableSessionState
to false and stop the calling of the PageLoad and the rest functions and reduce the overhead. So on top of the controls you declare:
<%@ Control AutoEventWireup="false" EnableViewState="false" ...
or for page:
<%@ Page AutoEventWireup="false" EnableViewState="false" EnableSessionState="false" ...
The disable of the session is let the pages loads in parallel, the disable of the EnableViewState is reduce the size, the AutoEventWireup is reduce the callback hooks and calls.
In general you can use what ever you wish - if your pages can work, but if you like to keep it robust and easy to change or update, or add new functionality in the future, then use dynamic aspx pages.
Similar question: Master page and performance
Upvotes: 2
Reputation: 27
I'd allways go with the aspx Page, because a dynamic Page is more work at the beginning but in the end it almost ever saves time. Specially when your not sure of the content that will be shown there, it is better. And for the one reason i do it, is to have everything the same. One style one way to code.
Upvotes: 3
Reputation: 5062
I'd say this is probably premature optimization. The overhead of an aspx page is in almost all cases negligible. I believe it's more likely that you will some day need to put dynamic things in that page, in which case you would have to convert the html file to an aspx, and change the url for your ajax dialog - which will cost time/money.
Upvotes: 2