开发者

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.


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.


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


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜