Click here to Skip to main content
15,885,914 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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:-
C#
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:-
a href='<%#String.Format("javascript:PrintItem({0}, '{1}')", Eval("Billno"), Eval("BranchCode")) %>

above href tag is in grid view.
Posted
Updated 20-Jun-15 3:25am
v3

It is deprecated. Please see my previous answer - ' window.ShowModalDialog ' not working in Chrome[^].
 
Share this answer
 
Comments
JOTHI KUMAR Member 10918227 20-Jun-15 9:15am    
i saw but nit understand how i call this print page as your view explain me details please
You can use window.open() or jQuery UI Dialog methods.
JOTHI KUMAR Member 10918227 20-Jun-15 9:26am    
if i use window.open()it will not work in ie. i update that question kindly change my code as your own
window.open should work in every browser. Have you checked the browser console if there are any errors or not?
If there is a space in the second parameter, it won't work. So, check it out.
You just don't have this function-type property in the object window in the browser you are using. This feature is deprecated and is going. Please see: https://developer.mozilla.org/en-US/docs/Web/API/Window/showModalDialog[^].

Don't use this function. There are many way better alternatives, such as jQuery dialog:
https://jqueryui.com/dialog[^].

Note that such dialogs (there are many more components like that collectively known "modal popup", with different features, such as visual effects, transitions, etc.) doesn't show "real" popup, but mimic modal behavior on the same page, which is much better.

—SA
 
Share this answer
 
Comments
JOTHI KUMAR Member 10918227 20-Jun-15 9:27am    
yeah i saw ur jquery dialog but it is sutiable for this bcz i want to pass a variable in that function.i update my question kindly see it.
Sergey Alexandrovich Kryukov 20-Jun-15 21:28pm    
It's your dialog, not just one function, so you can pass to it whatever you want.
—SA

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