asp.net| Static | Web environment: Microsoft. NET Framework SDK v1.1
Os:windows Server 2003 Chinese version
Asp. NET generates static HTML pages
The FileSystemObject object for generating static pages implemented in ASP!
This type
ASP. NET 2.0, a new realm of refreshing new pages
-- Davey --
"No refreshing page" is just an inaccurate effect description (in fact, there are other methods to achieve this effect). More specifically, it is said: on the page, use JavaScript to call a method on the server side and then process the returned data. The most standard method to implement it is, of co
How do I pass values between ASP. NET pages?Generally, there are the following types: querystring, session, cookies, application, server. Transfer
1. Use querystring variableQuerystring is a simple method for transferring values. It can display the transmitted values in the address bar of a browser. This method can be used to transmit one or more numeric values
Templates provided on the main webpage. Other webpages are on your website.Main webpageThe primary web page allows you to create consistent appearances and actions for all web pages (or a group of pages) on your network.The main webpage provides templates for other webpages to share the layout and functions. The content defined by the placeholder of the main web page, which can be overturned on the content
one, the current in the ASP.net page transfer value altogether has so several ways:1. Form submission....Form1.submit ();....This kind of side in the ASP. NET is not valid because of ASP. NET form is always submitted to its own page, if you want to submit to another page, you need special treatment.2, link address tran
Parameters and values are transmitted between ASP. NET web pages. There are many methods, such as Application, Cookie, Session, or Querystring.Most of the programs developed by Insus. NET are passed parameters and values between the backend, so Querystring is rarely used, but Session is used. Session? I will. Yes, all
As soon as you see the title "dynamic adding data rows to ASP. NET web pages", it seems a bit difficult to implement it. Because of the periodic nature of the web page, it is often difficult to retain the status after PostBack. However, Insus. NET wants to achieve this. You can click the "add" button on the webpage to
ASP. NET generates static Html and asp.net static based on existing dynamic pages
The current dynamic page format is similar to pageName. aspx? The ID = 1 format. The dynamic page must be converted to static html and uploaded later due to the Publishing Server.
First, obtain the page html by enumeration based on the format generated by the page:
1 for
In ASP. NET, there are three main methods for transferring values between pages. Querystring, session variable, and server. Transfer.
QueryString
Using QuerySting to pass values between pages is already a very old mechanism. The main advantage of this method is that it is very simple to implement, however, its disadvan
to clear Session. Remove ("session name ");Clear all: Session. Clear ();Example: (1) a. aspxCopy codeThe Code is as follows:Private void button#click (object sender, System. EventArgs e){Session ["name"] = Label. Text;} (2) B. aspxCopy codeThe Code is as follows:Private void Page_Load (object sender, EventArgs e){String name;Name = Session ["name"]. ToString ();} 3. Cookie This is also a common method. Cookies are used to store small pieces of information in a user's browser and store user-re
cookies.Server.trasfer (HttpContext)We can also use Server.Transfer (or HttpContext) to pass variables between pages, at which point the variables to be passed can be obtained through properties or methods, and using attributes will be easier. Public string getname{ getreturn txtName.Text;}}We need to use Server.Transfer to send this value to another page, note that Server.Transfer just sends the control to a new page, and does not redirect the
There is a problem with the refresh of the Asp.net page, and several methods of adding to favorites are quite useful.
First:Private void button#click (Object sender, system. eventargs E){Response. Redirect (request. url. tostring ());}Second:Private void button2_click (Object sender, system. eventargs E){Response. Write (" ");}Third:Private void button3_click (Object sender, system. eventargs E){Response. addheader ("refresh", "0 ");}Fourth:Private void button6_click (Object sender, system. even
return View () related introductionWhen you return to view in ASP. Viewresult, it inherits from Viewresultbase and it has a brother Partialviewresult. One to return the whole, and the other to return the local (HTML)Use the relevant1, controller writing: Except for the last change to "return Partialview ()" The remaining no difference2, depending on the book write: @Html. Partial () has four overloads. Choose according to the situation@Html. Partial (
by adding Donutoutputcache tags to the action or controller, and most outputcache tags can be used in Donutoutputcache. Public classHomecontroller:controller {[Donutoutputcache (Duration= -, varybyparam="username")] PublicActionResult Index (stringusername) { returnView (); } [Donutoutputcache (Duration= -)] PublicActionResult About () {Viewbag.message="Your Application description page."; returnView (); } PublicActionResult Contact () {Viewbag.message="Your C
, EventArgs e) {Get a value judgment and then assign a value based on the conditionif( This. Demo. style["Background-color"] =="Red") { This. Demo. style["Background-color"] ="Green"; } Else { This. Demo. style["Background-color"] ="Red"; } }} Public classstudent{Private stringStuname; Public stringStuname {Get{returnStuname;} Set{Stuname =value;} } Private stringStunumber; Public stringStunumber {Get{returnStunumber;} Set{Stunumber =value;} } Pr
you can access it on another page. However, the benefits of this method are also obvious. GenerallyThe method is concise and object-oriented. The entire process of using this method is as follows:
1. Add necessary controls to the page.
2. Create the get attribute process of the returned value
3. Create buttons and link buttons that can return the form
4. click the button to transfer the server. Transfer Method to the specified page.
5. On the second page, we can use context. the handler propert
=utf-8"/> "Form1"runat="Server"> "Label1"runat="Server"text="Label">(4) B.aspx.csusingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingsystem.web;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;namespacewebapplication{ Public Partial classB:system.web.ui.page {protected voidPage_Load (Objectsender, EventArgs e) {Label1.Text= request.cookies["UserName"] !=NULL? request.cookies["UserName"]. Value:"The cookie value has expired"; //ternary expression, equivalent to the code of the foll
On ASP. NET pages, you often need to link some JS files, such:
Script Language = " Javascript " SRC = " /AA. JS/ " > Script > If there is a Chinese character in JS, an error is reported in the browser.If you do not believe it, try it yourself. This is actually the case:In a project automatically generated by vs.
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.