Some ASP.NET tips

xiaoxiao2021-03-06  106

OpenFile Dialog in WebForm If you need a OpenFile dialog that opens the file on the browser, you can use HTML's INPUT to set its type to file:

Page_Load & ISPostback In the ASP.NET application, if you do some initialization operations when you need to display the page for the first time, you must judge the ISPOSTBACK property, for example:

Private Void Page_Load (Object Sender, System.EventArgs E)

{

IF (! this.ispostback)

{

// ... Initialize

}

}

Web Forms calls each other in ASP.NET applications, and if you need to implement Mutual calls like WinForm, the easiest way is to use the REDIRECT method of the Response object, for example:

Response.Redirect ("Webform2.aspx");

The parameter delivery between WebForms is like the Form, which may also need to pass some status parameters between WebForm, such as the login page may need to pass the current username to Main Page. You can use the HttpSessionState type SESSION Object, for example:

// A WebForm:

Session.Add ("UserName", txtusername.text);

// Another WebForm:

String shello = "Hello" session ["username"];

Implement color gradient with Style

转载请注明原文地址:https://www.9cbs.com/read-122957.html

New Post(0)