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 );