0

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.

Rocky
  • 4,454
  • 14
  • 64
  • 119

4 Answers4

1

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.

Community
  • 1
  • 1
Oded
  • 489,969
  • 99
  • 883
  • 1,009
0

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".

Alex
  • 8,827
  • 3
  • 42
  • 58
AKhan
  • 1
0

Look at JavaScript alert title header or How to edit a JavaScript alert box title?.

Community
  • 1
  • 1
detaylor
  • 7,112
  • 1
  • 27
  • 46
  • I am using JavaScript jquery.. the code is code behind Page.ClientScript.RegisterStartupScript(this.GetType(), "Window", "callAlert();", true); and on the ascx page i have written $(document).ready(function() { $('#ImageButton1').click(function() { jAlert('Please enter a valid Suggestion ID.', 'Case Entry'); }); }); script but the problem is alert box is getting automatically disabled when page is loading fully anyone help me.... how to stop autopost back – Rocky Apr 22 '11 at 12:34
0

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

Rocky
  • 4,454
  • 14
  • 64
  • 119