|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
MessageBox not showing before Response.RedirectI am showing a messagebox with the following method: public static void ShowMessageBox(HtmlTextWriter htmlTextWriter, string message) { htmlTextWriter.Write("<script language=JavaScript>window.alert('"+message+"');</script>"); htmlTextWriter.Flush(); } // end method showMessageBox Now I am calling it with the following way: HtmlTextWriter htmlTextWriter; htmlTextWriter = this.CreateHtmlTextWriter(Context.Response.Output); ShowMessageBox(htmlTextWriter, "Hello."); When I add Response.Redirect(...), message box is not being shown while when I do not set Respones.Redirect, it works. Is there a way how I can solve this problem. Thanks in Advance Hi Xarky,
In order to show message box then redirect to other page, you should use client-side redirect rather than server- side Redirect (Response.Redirect). For example, RegisterStartupScript("redirect", "<script language=JavaScript>alert('Message'); open ('http://www.yahoo.com');</script>") Show Message first. Once click OK it opens yahoo page in new window. If you want to keep new page in same window, you need more javascript code. HTH Elton Wang elton_W***@hotmail.com >-----Original Message----- ('"+message+"');</script>");>Hi, >I am showing a messagebox with the following method: > >public static void ShowMessageBox(HtmlTextWriter htmlTextWriter, >string message) >{ > htmlTextWriter.Write("<script >language=JavaScript>window.alert > htmlTextWriter.Flush(); (Context.Response.Output); >} // end method showMessageBox > > >Now I am calling it with the following way: > >HtmlTextWriter htmlTextWriter; >htmlTextWriter = this.CreateHtmlTextWriter Show quoteHide quote >ShowMessageBox(htmlTextWriter, "Hello."); > >When I add Response.Redirect(...), message box is not being shown >while when I do not set Respones.Redirect, it works. > >Is there a way how I can solve this problem. >Thanks in Advance >. > Hi,
I require to open the new page in the same window. *** Sent via Developersdex http://www.developersdex.com ***
Designer locking mdb file... (file and dir GRANTS FULL CONTROL FOR "EVERYONE")
Howto insert delete rows into a ASP.net datagrid? Datagrid Paging Stretch Data read row values from datagrid and populate in new datagrid values from connected Programmatically Rotate Datagrid Rows ItemDataBound Datagrid paging keeps going back to the first group Accessing data object on delete command. filtering from multiple dropdownlists Slow datagrid on postback |
|||||||||||||||||||||||