Rocky
Rocky

Reputation: 4524

How could i change the msgbox title "The page at http://.... says:"

I am opening the msgbox in asp.net by following code..

if (ds.Tables[0].Rows[0][12].ToString() == "0" )
   Page.ClientScript.RegisterStartupScript(this.GetType(), "Window", "alert('This ID is not yet approved to create a case. ');", true);
else if(ds.Tables[0].Rows[0][12].ToString() == "2")
   Page.ClientScript.RegisterStartupScript(this.GetType(), "Window", "alert('Your ID is rejected to create a case. ');", true);
else
   Page.ClientScript.RegisterStartupScript(this.GetType(), "Window", "alert('Please enter a valid ID.');", true);

When its running on mozilla browser Message Box title showing The page at http://.... says:

I want to change this title and show my custom title a part from The page at http://.... says:

Any open help me soon.

Upvotes: 0

Views: 3748

Answers (4)

AKhan
AKhan

Reputation: 1

you can try this

MsgBox("Hi", MsgBoxStyle.MsgBoxSetForeground, Title)

it will display the title of your web page. for eg if your web page has title "My home page", then the title of the massage box will be "My home page".

Upvotes: 0

Rocky
Rocky

Reputation: 4524

Use custom alert message box, for changing the title else you can't change the title

for more details check this link

http://javascript.internet.com/miscellaneous/custom-alert-box.html

Upvotes: 0

Oded
Oded

Reputation: 499142

You can't change this title.

The alert box is generated by the browser and the title is not something that can be controlled via javascript.

The best you can do is create your own alert box in javascript (for example using jQuery UI).

See this SO question.

Upvotes: 1

Related Questions