Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the title of javascript alert box in asp.net?

In ASP.Net I am using an ImageButton on click of which I am showing JavaScript confirm button like below:

<asp:ImageButton ID="imageButtonDelete" ImageUrl="~/Styles/images/delete.png" CommandArgument='<%#Eval("regionId") %>' OnClientClick="javascript:return confirm('Are you sure you want to delete?');" Text="Delete" CommandName="Delete" runat="server" Width="20px" Height="20px" />

However, in Chrome, the title of the alert box shows -

the page at localhost:1150 says

I don't want the page at... text. How to change that?

like image 839
user2380844 Avatar asked Oct 21 '22 15:10

user2380844


2 Answers

Sorry, but you can't it's a security/anti-phishing feature, Refer this link for more information change alert title

However, if you want to display a box to the user then you can construct such box through jquery modal. Here is a nice link which shows how to create it jquery-modal

like image 122
Saumil Avatar answered Oct 24 '22 12:10

Saumil


This should not be specific to ASP.net, but specific to the browser.

You may use some JavaScript library like jQuery Alert, etc. for generating a JavaScript confirm box which would work in a similar way.

like image 42
Vivek Jain Avatar answered Oct 24 '22 12:10

Vivek Jain