One, cross-page values and values:
1, Querystring-url transfer value, address transfer value
Advantages and disadvantages: Do not occupy server memory, confidentiality is poor, transmission length is limited.
By jumping the page path to pass the value, the way:
href= "Address? Key=value&key=value" can pass multiple values with &.
In this way, the value to be passed to the page to jump to.
2, cross-page value:
Value on the C # code service side of the page that jumps to
Used: String value = request["key"];
Second, C # end page jump
Current page Jump:
response.redirect ("url"); You can also send a value in this jump address.
To open a new page window:
Response.Write ("<script>window.open (' default2.aspx ', ' _blank ');</script>");
Response.Write () prints the contents of the parentheses intact to the top of the HTML page. Inside can put JS, the above example is through JS to realize the opening of a new page.
OnClientClick Property of button
The OnClientClick property is used to set a client script to run when the Button control is clicked.
<asp:button id= "Button1" onclientclick= "return Buttonisok ()" runat= "server" text= "register"/>
The OnClientClick property of the button control controls the commit of the button, the property value is true to be committed, and the property value is False is not committed.
Buttonisok () is a method written in JS that only returns TRUE or False. You can implement the submit function of the control button.
JS Knowledge Point review:
button Click event: Opens a new page with no menu, no navigation bar, width 450 High 500 , the address is update.aspx and passes a value. This value is obtained by a custom attribute ' bh ' of this button
document.getElementById ("Btn1"). Onclick=function () {
window.open ("update.aspx?i=" + this.getattribute (' bh '), "_blank", "toolbar=no menubar=no width=450 height=500")
}
Button code: <input id= "BTN1" type= "button" bh= "<% #Eval (" Ids ")%>" value= "edit"/>
Hyperlinks:
do you want to delete the popup box? Click OK to connect to the address that is written in the href.
<a onclick= "return confirm (' Delete <% #Eval (" nickname ")%>? ' href= ' delete.aspx?i=<% #Eval ("Ids")%> "> Delete </a>
"2017-05-21" webform cross-page value, C # service-side Jump page, button's OnClientClick property, JS getattribute and hyperlinks Click the pop-up alert box.