1. PreInit()In this Page level event, all controls created during design time are initialized with their default values. For e.g., if you have a TextBox control with Text property = “Hello”, it would be set by now. We can create dynamic controls here.This event occurs only for the Page class and UserControls/MasterPages do not have this method to override. Sample code where you can override this method and add your custom code:protected override void OnPreInit(EventArgs e){//custom codebase.OnPreInit(e);}Note that PreInit() is the only event where...
Monday, March 17, 2008
Sunday, March 16, 2008
TIPS : Difference between Response.Write and Response.Output.Write
The Respose.Write() : just outputs a string to web page and it writes the text stream.Response.Output.Write() : formats the string as per specified options before writing to the the web page and it gives you String.Format - style formatted output and it writes the HTTP Output Stream.FOR Example:Response.Write("Current Date Time is " + DateTime.Now.ToString() ); Response.Output.Write ("{0} is {1:d}", "Current Date Time is: ", DateTime.Now); Hope this will help you...