เปิดหน้าต่างใหม่หลังจากเหตุการณ์คลิกปุ่ม

ฉันกำลังพยายามเปิดหน้าต่างใหม่หลังจากเหตุการณ์การคลิก มันเปิดหน้าเดียวกัน แต่ไม่ใช่หน้าที่ฉันส่งเป็นพารามิเตอร์ URL

ScriptManager.RegisterStartupScript(Page, GetType(), "OpenWindow", "window.open('Report.aspx','mywindow','menubar=1,resizable=1,width=900,height=600');", true);

person Argenis Rosario    schedule 15.05.2019    source แหล่งที่มา
comment
ตรวจสอบโดยใช้เครื่องมือเบราว์เซอร์ของคุณเพื่อหาข้อผิดพลาดของจาวาสคริปต์   -  person Aristos    schedule 15.05.2019
comment
คุณพยายามใส่ที่อยู่ทั้งหมดแทน Report.aspx หรือไม่ (เช่น example.com/Report.aspx)   -  person Hossein Badrnezhad    schedule 15.05.2019
comment
@Aristos ไม่มีข้อผิดพลาดบนคอนโซล   -  person Argenis Rosario    schedule 15.05.2019
comment
@HosseinBadrnezhad ใช่ ฉันลองใส่ที่อยู่ทั้งหมดแล้ว เช่น ~/Report.aspx (หน้าอยู่บนรูท)   -  person Argenis Rosario    schedule 15.05.2019
comment
ฉันลองใช้รหัสของคุณแล้วและมันก็ใช้งานได้ แต่เปิดเพจในป๊อปอัปไม่ใช่แท็บใหม่   -  person Hossein Badrnezhad    schedule 15.05.2019
comment
ฉันพบปัญหา มันเป็นการตรวจสอบความถูกต้องของแบบฟอร์มที่ฉันพยายามเปิด มันทำให้ฉันกลับมาหน้าแรก... แย่เลย ขอบคุณสำหรับคำตอบ   -  person Argenis Rosario    schedule 15.05.2019


คำตอบ (2)


คุณสามารถใช้ (แสดง) หน้าต่างป๊อปอัป Bootstrap Modal จากฝั่งเซิร์ฟเวอร์ (โค้ดด้านหลัง) ใน ASP.Net ตรวจสอบตัวอย่างด้านล่างด้วย

https://www.aspsnippets.com/Articles/Open-Show-Bootstrap-Modal-Popup-Window-from-Server-Side-Code-Behind-in-ASPNet.aspx

หรือ

HTML

<a href="/th#" onclick="javascript:return ViewAndApprove('<%# DataBinder.Eval(Container.DataItem,"Name")%>','<%# DataBinder.Eval(Container.DataItem,"Email")%>')">
                                    Edit </a>

จาวาสคริปต์

 <script type="text/javascript">
<!--
  function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
 }
 function ViewAndApprove(i,J)
    {
             window.open('Report.aspx?UserName='+i+'&UserEmail='+J,'RPO','scrollbars=yes,width=540,height=300;');
    }

 //-->
</script>
person mohd mazhar khan    schedule 16.05.2019

ฉันพบปัญหา มันเป็นการตรวจสอบความถูกต้องของแบบฟอร์มที่ฉันพยายามเปิด มันทำให้ฉันกลับมาหน้าแรก... แย่เลย ขอบคุณสำหรับคำตอบ

person Argenis Rosario    schedule 17.05.2019