Is this true? it is not possible to change the content of the buttons in the dialog displayed by the confirm function
This is my code to display a pop-up the our user to confirm his data:
The user wants to see Yes/No instead of OK/Cancel. It's true I can't use confirm?Code:Queue queue = (Queue)(handlerPages[HttpContext.Current.Handler]); if ((queue != null)) { StringBuilder builder = new StringBuilder(); int iMsgCount = queue.Count; builder.Append("<script language='javascript'>"); string sMsg = string.Empty; while ((iMsgCount > 0)) { iMsgCount = iMsgCount - 1; sMsg = System.Convert.ToString(queue.Dequeue()); sMsg = sMsg.Replace("\"", "'"); string[] QueueArray = sMsg.Split(','); builder.Append("if(confirm( \"" + QueueArray[0] + "\" )) {"); builder.Append("location.replace('pageA.aspx?');"); builder.Append("} else {"); builder.Append("location.replace('pageB.aspx?');"); builder.Append("}"); } builder.Append("</script>"); handlerPages.Remove(HttpContext.Current.Handler); HttpContext.Current.Response.Write(builder.ToString()); }
I did not write this code and I'll admit I don't understand it, so the first thing I will do is dissect it. But do I also have to rewrite it?
Thanks.