In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
How to introduce ASP.NET and Web forms page, I believe many inexperienced people don't know what to do about it. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
In ASP.NET pages, user interface programming is divided into two different parts: visual components (views) and logic that combines models and controllers. This division separates the visual part of the page (view) from the code (model and controller) behind the page that interacts with the page.
Visual elements are called Web forms pages. The page consists of a file that contains static HTML server controls or ASP.NET server controls, or both. The form page in this example consists of the following code:
Untitled Page
Name:
The logic of a Web forms page consists of code created to interact with the form. The programming logic is placed in a file separate from the user interface file. This file is called a "code behind" file:
Using System; using System.Web; using System.Web.UI; namespace PageController {public partial class _ Default: System.Web.UI.Page {protected void SubmitBtn_Click (object sender, EventArgs e) {mySpan.InnerHtml = "Hello,"+ name.Text +". ";}
This class provides a default implementation that can be overridden by a derived class.
Using System; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace PageController {public partial class BasePage: Page {protected Label eMail; protected Label siteName; override protected void OnInit (EventArgs e) {/ / this.Load + = new System.EventHandler (this.Page_Load); base.OnInit (e);} protected void Page_Load (object sender, System.EventArgs e) {if (! IsPostBack) {string name = Context.User.Identity.Name EMail.Text = DatabaseGateway.RetrieveAddress (name); siteName.Text = "my cool site"; PageLoadEvent (sender, e);}} / / this method can be overridden by sub class. Virtual protected void PageLoadEvent (object sender, System.EventArgs e) {}} after reading the above, have you mastered how to introduce ASP.NET and Web forms? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.