Several asp.net skills _ self-study Process

Source: Internet
Author: User
OpenFile Dialog in WebForm
If you need a OpenFile dialog box that opens a file on the browser side, you can use 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=" id= "Txtfilepath" >




Page_Load and IsPostBack
In a asp.net application, if you need to perform some initialization when the page is first displayed, you must determine the IsPostBack property, for example: private void Page_Load (object sender, System.EventArgs e)
{
if (! This.ispostback)
{
... Initialize
}
}




Web Forms Call each other
In asp.net applications, if you need to implement WinForm calls like that, the easiest way is to use the Redirect method of Response objects, such as: Response.Redirect ("webform2.aspx");



Parameter passing between the WebForm
Just as there is often a need for reciprocal parameters between form, WebForm may also need to pass some state parameters, such as the login page may need to pass the current username to main page, You can use the HttpSessionState type of Session object at this time, for example://One webform:
Session.add ("UserName", txtUsername.Text);
In another webform:
string Shello = "Hello" + session["Username"];

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.