For starters, don't do the redirect from the server. You can do redirection in javascript too.
On Mar 9, 11:20 am, stapes <[email protected]> wrote: > I am trying to display a javascript alert, but we are using > response.redirect to go to a new page. This is where I call the > routine: > > Utils.RedirectMsg("Warning: Some data may be lost. Maximum field > length 3000 characters.","~/AdminForms/VolAdmin.aspx"); > > This is the called routine: > > public static void RedirectMsg(string strMsg, string newPage) > { > > Page thisPage = > (Page)HttpContext.GetLocalResourceObject(newPage, "resourcesid"); > string javaScript = string.Format("window.alert('{0}');", > strMsg); > thisPage.ClientScript.RegisterStartupScript( > typeof(Page), > "MessagePopUp", > javaScript, > true); > } > > I have no idea how "resourceid" is meant to work, but I am getting > this error: > > The resource class for this page was not found. Please check if the > resource file exists and try again. > > My normal pop-up message works. It looks like this: > > public static void MsgBox(string strMsg) > { > Page currentPage = (Page)HttpContext.Current.Handler; > string scriptKey = "AlertScript"; > string javaScript = string.Format("window.alert('{0}');", > strMsg); > > currentPage.ClientScript.RegisterStartupScript( > currentPage.GetType(), > scriptKey, > javaScript, > true); > } -- You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en or visit the group website at http://megasolutions.net
