2014-09-10 6 views
0

아래 코드에서 링크 버튼을 클릭하면 링크 버튼이 열립니다. 크롬에서 팝업 창이 열리는 반면 IE 및 mozilla에서는 팝업이 작동하지 않아 문제를 해결할 수 있습니다.Linkbutton Google 크롬에서 작동하지 않습니다

<asp:TemplateColumn HeaderText="From Quote" ItemStyle-Width="200px"> 
          <ItemTemplate>            
           <asp:LinkButton ID="lnkQuote" runat="server" CommandName="Quote" Text="Quote" /> 
          </ItemTemplate>   
          </asp:TemplateColumn> 

if (e.CommandName.Equals("Quote")) 
       { 
    Label KK = (Label)dgPOD.Items[e.Item.ItemIndex].Cells[1].FindControl("TXT1"); 
        Label lbl = (Label)dgPOD.Items[e.Item.ItemIndex].Cells[1].FindControl("LBL1"); 
        str1 = KK.Text.ToString(); 
        str2 = lbl .Text.ToString(); 

        ScriptManager.RegisterStartupScript(this, GetType(), "ShowPopUp", "ShowPopUp()", true); 
       }  
+0

자바 스크립트 오류가 발생합니까? 스크립트가 페이지에 렌더링됩니까? 크롬에서 콘솔의 ShowPopUp() 호출은 작동합니까? –

답변

0

를 추가해보십시오 주변 스크립트 태그

ScriptManager.RegisterStartupScript(this, GetType(), "ShowPopUp", "<script type=\"text/javascript\">ShowPopUp();</" + "script>", true); 
+0

작동하지 않습니다 – user3930037

1

이 코드를 추가합니다. 그것은 잘 작동합니다.

 <!DOCTYPE html> 
     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org 
     /TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     <html xmlns="http://www.w3.org/1999/xhtml"> 

<head runat="server"> 
<meta http-equiv="X-UA-TextLayoutMetrics" content="natural" /> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 
<meta http-equiv="X-UA-Compatible" content="IE=9" /> 
<meta http-equiv="X-UA-Compatible" content="IE=8" /> 
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> 
</head> 

도움이 될 경우 투표하십시오.

0
ClientScript.RegisterStartupScript(this.GetType(), "ShowPopUp", "ShowPopUp()", true); 
+0

일부 설명을 추가해야합니다. 그렇지 않은 경우 품질이 낮아 응답을 삭제할 수 있습니다. – CSchulz

+0

죄송합니다! 내 영어 실력이별로 좋지 않아. –

+0

당신은 그것을 시도해야합니다 :) 당신은 더 많은 투표와 비슷한 것을받을 수 있습니다. :) – CSchulz

관련 문제