ASP.Net learning notes

07 Mar

  • Use application settings, instead of user settings as in Winform applications;
  • In the page_load function, enclose the initializaton logic in a if (!IsPostBack) { } block. This will ensure that in the postback mode, your control’s status will not be re-initialized.
    protected void Page_Load(object sender, EventArgs e) {
    if (!IsPostBack)
  • Using the ScriptManager together with UpdatePanel, some GUI update can be triggered in response to some actions, this can be done by configuring the “Triggers” property, which contains a collection of events, for intance, a button ‘s click, a RadioButtonList’ s SelectedIndexChanged etc. Remember to set the button/RadioButtonList ‘s “AutoPostBack” property to “true”;
  • In a long running process, we can use UpdateProgress control to provide some hints. Drag an UpdateProgress control, and configure its “AssociatedUndatePaneID” to be the UpdatePanel which you wish to monitor or update, configure the “DisplayAfter” to some time intervals, beyond which the UpdateProgress will show some hints.
  • In case the IIS does not work, you wish to uninstall first and then reinstall, remember to unintall “Windows Process Activation” as well, as this is what IIS depends. Otherwise, you will probably encounter problems or failures when reinstall IIS on the system.


  • When packaging your web project, remember to add both the “Primary output” (DLL) and the “Content files” (aspx) in the setup project.


  • Use ConfiguationManger.AppSettings[“SomeVaribleName”] to access the global varibles which are not hardcoded.
  • <% Trace=true %> will enable the page tracing for a *.aspx file; while in the web.config, in the node <system.web> </system.web>, if <trace enabled=”true”/> then the event triggered will be traced. To view the tracing log, in the browser’s URL, type http://YourWebUrl/Trace.adx and this will offer more details to you.
Leave a comment

Posted by on March 7, 2009 in Dotnet/C#


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: