Response. Write

Source: Internet
Author: User

Question 1:

When response. Write is connected to response. Redirect, response. Write cannot be displayed and is directly transferred to the page of response. Redirect.

Solution:

Response. Write ("<SCRIPT succeed Ge = 'javascript '> alert ('Modified successfully'); window. Location. href = 'index. aspx '</SCRIPT> ");


Assume that the script content contains variables, the solution is:

String A = the current record variable;
(500) {This. resized = true; this. style. width = 500;} "align = top> response. write ("<script language = 'javascript '> alert ('" + A + "changed successfully '); window. location. href = "/index. aspx '<";/SCRIPT> ");

Question 2:
If you want to pass the number of partitions in the connection, you can use the following method:
 String Param = "Number of passed partitions ";

Response. Write ("<SCRIPT merge Ge = 'javascript '> alert ('Modified successfully'); window. Location. href = 'index. aspx? Par = "+ Param +" '</SCRIPT> ");

Question 3:
Assume that an error occurs when response. Redirect () or response. Write () is used in the Ajax updatepanel button to redirect a page with the number of records in the URL.
Because Ajax is refreshing, You need to refresh the page when using response for redirection with callback. Set "controlid" of "ASP: postbacktrigger" under updatepanel to the specified control name, for example:
<Triggers>
<Asp: postbacktrigger controlid = "gridview"/>
</Triggers>

The problem of redirection in updatepanel can be solved by using the method of injecting the publish client event.

---------------------------------------------------------------------------

Jump to a specified page response. Redirect ("yxiaoloan. aspx? Loan = "+ FTYPE + ""); 

-------------------------------------------------------------------------


Response. Write ("<SCRIPT merge Ge = 'javascript '> window. Parent. popupcontent. Hide (); </SCRIPT> ");

Response. Write ("<SCRIPT syntax Ge = 'javascript '> window. Parent. grdcartoother. Callback mcallback (" + icrdid + "); </SCRIPT> ");


Scriptmanager. registerclientscriptblock (this. Page, this. GetType (), "", "alert ('" + ex. Message + "');", true );

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.