当我单击以下按钮时,它会打开页面两次。我似乎找不到错误:
.cs 文件:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
btnPrint.Attributes.Add("onclick", "openWindow(" + Request.QueryString["cId"].ToString() + "," + Request.QueryString["aId"].ToString() + ");");
}
}
的JavaScript:
<script type="text/javascript">
//Function To Open A New Window To View the selected PDF
function openWindow(cId, aId) {
window.open("printMe.aspx?cId=" + cId + "&aId=" + aId + "", "", "", "");
}
</script>
和 aspx 中的按钮:
<dx:ASPxButton ID="btnPrint" runat="server" Image-Url="~/images/print.bmp" ToolTip="Printer Friendly Page">
</dx:ASPxButton>