OpenFile Dialog in WebForm
If you need an OpenFile dialog box that opens a File in a browser, you can use the HTML Input to set its Type to File: <INPUT style = "Z-INDEX: 102; LEFT: 145px; WIDTH: 468px; POSITION: absolute;
TOP: 228px; HEIGHT: 25px "type =" file "size =" 58 "id =" txtFilePath ">
Page_Load and IsPostBack
In ASP. NET applications, if you need to perform initialization operations when the page is displayed for the first time, you must determine the IsPostBack attribute, such as private void Page_Load (object sender, System. EventArgs e)
{
If (! This. IsPostBack)
{
//... Initialize
}
}
Web Forms mutual calls
In ASP. NET applications, if you need to implement mutual calls like WinForm, the simplest way is to use the Redirect method of the Response object, for example: Response. Redirect ("WebForm2.aspx ");
Parameter transfer between webforms
Just as parameters need to be passed between forms, some status parameters may need to be passed between webforms. For example, Login page may need to pass the current UserName to Main page, in this case, you can use a Session Object of the HttpSessionState type, such as: // In A WebForm:
Session. Add ("UserName", txtUserName. Text );
// In another WebForm:
String sHello = "Hello" + Session ["Username"];