Click here to Skip to main content
15,905,563 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi to all,
Window.showmodaldialog is opening in ie but no open in chrome . how to work with chrome also.kindly help me for this. below code i used.

code:-
Hide Copy Code
function PrintItem(ID, BID) {

window.showModalDialog('./ProductSalesBill.aspx?Req=N&SID=' + ID + '&BID=' + BID, self, 'dialogWidth:800px;dialogHeight:530px;status:no;dialogHide:yes;unadorned:no;');
}

here i call this print item like this below code is in gridview:-
a href='<%#String.Format("javascript:PrintItem({0}, '{1}')", Eval("Billno"), Eval("BranchCode")) %>

above href tag is in grid view.

here i want to open both browser Kindly help for this thanks in advance.
Posted

Don't use showModalDialog(); this is not a standard function; and don't use window.open — in most cases, popups are ugly, intrusive, and will be blocked by many users through appropriate browsers' plug-ins.

Better use the jQuery with so-called modal popup technique which only mimic modal behavior on the same page. It makes UI really neat and is suitable for single-page applications. Please see: https://jqueryui.com/dialog[^].

Also, there are many 3-rd party plug-ins featuring different visual effects, such as transitions and, notably, dimming: http://bfy.tw/Vdm[^].

If you need to learn jQuery (highly recommended), please see:
http://en.wikipedia.org/wiki/JQuery,
http://jquery.com,
http://learn.jquery.com,
http://learn.jquery.com/using-jquery-core,
http://learn.jquery.com/about-jquery/how-jquery-works (start from here)…

—SA
 
Share this answer
 
Comments
JOTHI KUMAR Member 10918227 25-Jun-15 3:23am    
here im ready to use jquery but how to write code can anyone explain one example ???
Sergey Alexandrovich Kryukov 25-Jun-15 11:44am    
There are tons of examples everywhere, each page of jQuery documentation comes with example, I reference the page where to start with. What else would you possibly need? Perhaps doing some work. And please accept my answer formally.
—SA
Use jquery dialog box it will work on all browsers and best things its easy customisable and if needed multiples animations can be added to it...

Sample Code

<!doctype html>
<html>
<head>
<title>jQuery UI Dialog</title>
<script src="http://code.jquery.com/jquery-2.1.4.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.24/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/ui/1.8.24/jquery-ui.js"></script>
<style>
.center{
position:fixed;
left: 50%;
top: 50%;
}
</style>
</head>
<body>

<div>
<a id="test" class="center" href="#">link text</a>
</div>

<div id="dialog" title="Basic dialog" style="display: none">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>

<script>
$("#test").on('click', function () {
$("#dialog").dialog();
});
</script>
</body>
</html>
 
Share this answer
 
window.showModalDialog() does not work in chrome..its a well known issue

Use windows.Open()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900