Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Clicking on Hyperlink in the GridView -Popup is not working in Chrome.

But, working nicely in IE .

Please help. Thanks in Advance

CODE:


XML
<dx:GridViewDataColumn FieldName="Orderno" Caption="Order" UnboundType="String" CellStyle-CssClass="myStyle"
   Width="10%" VisibleIndex="2" HeaderStyle-HorizontalAlign="Center">
   <DataItemTemplate>
       <dx:ASPxHyperLink ID="hyperLink" runat="server" OnInit="hyperLink_Init">
       </dx:ASPxHyperLink>
   </DataItemTemplate>
</dx:GridViewDataColumn>

c#


C#
protected void hyperLink_Init(object sender, EventArgs e)     //added by kav 30thJuly'2014
{
    try
    {
        ASPxHyperLink link = (ASPxHyperLink)sender;
        GridViewDataItemTemplateContainer templateContainer = (GridViewDataItemTemplateContainer)link.NamingContainer;
        int rowVisibleIndex = templateContainer.VisibleIndex;
        string ean13 = templateContainer.Grid.GetRowValues(rowVisibleIndex, "INVOICE_AUTO_ID").ToString();
        string Order = templateContainer.Grid.GetRowValues(rowVisibleIndex, "Orderno").ToString();
        link.NavigateUrl = "javascript:void(0);";
        link.Text = Order;
        if (Order.ToLower() == "Bonus".ToLower())
        {
            Order = Order + ","+ ean13;
        }
        link.ClientSideEvents.Click = string.Format("function(s, e) {{ OnMoreInfoClick('{0}'); }}", Order);


    }
    catch (Exception ee)
    {
    }
}

JavaScript


C#
function OnMoreInfoClick(contentUrl) {
    debugger;
    var w_r_v = window.showModalDialog('Commissions/Invoice_Calculation_list.aspx?Invoice_auto_id=' + contentUrl, null, 'status:no;dialogWidth:800px;dialogHeight:420px;dialogHide:true;help:no;scroll:auto;maximize:yes');
}


__Kav


[Edit member="Tadit"]
Added pre tags.
Formatting changes.
[/Edit]
Posted
Updated 9-Oct-14 23:33pm
v3
Comments
kavitha3 30-Sep-14 3:43am    
Hi ,
Anyone Please help ....

Expanding on Solution #4 with links from my previous answer[^] to a different but similar question:

The window.showModalDialog function has been disabled as of Chrome 37:
http://blog.chromium.org/2014/07/disabling-showmodaldialog.html[^]

You might be able to change a setting on the client to temporarily re-enable it until May 2015:
http://codecorner.galanter.net/2014/09/02/reenable-showmodaldialog-in-chrome/[^]

However, you should be looking to replace this call with an alternative. For example:
https://github.com/GoogleChrome/dialog-polyfill[^]
http://jqueryui.com/dialog/[^]
http://getbootstrap.com/javascript/#modals[^]
 
Share this answer
 
once you try like this am not sure it is working in my project
 aName.Attributes["onclick"] = "javascript:OnMoreInfoClick(" + OnMoreInfoClick + ");";


                             (or)

public void ScriptFunction(string function)
{
   ScriptManager.RegisterStartupScript(this, this.GetType(), "jscript", function, true);
}

ScriptFunction("window.setTimeout('OnMoreInfoClick ("+ Order +")', 100)");
 
Share this answer
 
window.showModalDialog has been deprecate starting with Chrome 37.
 
Share this answer
 
Comments
kavitha3 6-Oct-14 0:46am    
Can u please tell me what to do with Chrome37 . Please

I refered this URL: http://www.bugdebugzone.com/2014/08/sitecore-modal-pop-ups-are-not-working.html

it worked well in the Chrome37 .
but, as you know changing the settings in each and every system is not possible right sir ..
can u please help how to do programatically sir
or any other solution sir ..
Please help sir..
check popup is allow or not for that browser in settings
 
Share this answer
 

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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