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> ");
If the script content contains variables, the solution is:
String a = the current record variable;
// Response. write ("<script language = 'javascript '> alert ('" + a + "modified successfully '); window. location. href = "/index. aspx '<";/script> ");
Response. write ("<script language = 'javascript '> alert ('" + a + "modified successfully '); window. location. href = '/index. aspx '</script> ");
Question 2:
To pass parameters in a connection, you can use the following methods:
String param = "passed parameters ";
Response. Write ("<script succeed Ge = 'javascript '> alert ('Modified successfully'); window. location. href = 'index. aspx? Par = "+ param +" '</script> ");
Question 3:
If an error occurs when Response. Redirect () or Response. Write () is used in the Ajax UpdatePanel button for URL-based page redirection.
Because Ajax is refreshing, You need to refresh the page when using Response to redirect with parameters. In UpdatePanel, set "ControlID" of "asp: PostBackTrigger" to the specified control name, for example:
<Triggers>
<Asp: PostBackTrigger ControlID = "GridView"/>
</Triggers>