-1

i used code to display mesaage box in asp.net as follows

Dim myscript As String = "alert('Please Enter The Patients Inpatient number');window.location.replace(window.location.href);" Page.ClientScript.RegisterStartupScript(Me.GetType, "MyScript", myscript, True)

this displays alert box with message as 'Pleas enter the inpatients number" but title bar of the message box shows Windows internet Explorer Is it possible to change the name of this.

VMAtm
  • 27,943
  • 17
  • 79
  • 125
user1702346
  • 121
  • 3
  • 7
  • 14
  • possible duplicate of [How to edit a JavaScript alert box title?](http://stackoverflow.com/questions/1905289/how-to-edit-a-javascript-alert-box-title) – Adriaan Stander Oct 31 '12 at 05:31

2 Answers2

0

You can't really change an alert box's title.. But what you can do is override the alert function and display your custom message using some div. This way, you will have total control over the appearance of the messagebox.

Check this link to see how this is implemented. Custom alert using Javascript

-->new edit

paste the code given in youe .aspx page, then call the alert using below code in your .cs file.

Dim myscript As String = "alert2('Please Enter The Patients Inpatient number','Message From My Custom page','Ok');    window.location.replace(window.location.href);"
 Page.ClientScript.RegisterStartupScript(Me.GetType, "MyScript", myscript, True)
Community
  • 1
  • 1
patil.rahulk
  • 574
  • 1
  • 3
  • 13
  • 1
    i didnt get can u explain more thanks for immediate response thank u – user1702346 Oct 31 '12 at 05:42
  • Check the link which i pasted above, Walter Stabosz has given a code which creates a custom alert function using JQuery. you can copy-paste that function in your page and whenever you want to display an alert, use **alert2(message, title, buttonText)** instead – patil.rahulk Oct 31 '12 at 05:48
  • i checked but i didnt get idea in which page ishould write the code please help me – user1702346 Oct 31 '12 at 06:11
0

Technically you can change what alert function does but you cannot change the title and other things of alert box. Instead of using alert box I suggest you to use jQuery functionality i.e. dialog box. Checkout the following link. Custom alert box You need to do a quite little changes and sure you will get your result.

Sagar Upadhyay
  • 819
  • 2
  • 11
  • 31