Every time I click on the button below, it seems to open the page twice. I'm having trouble identifying the issue:
The code in the .cs file:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
btnPrint.Attributes.Add("onclick", "openWindow(" + Request.QueryString["cId"].ToString() + "," + Request.QueryString["aId"].ToString() + ");");
}
}
The javascript function:
<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>
The button in the aspx file:
<dx:ASPxButton ID="btnPrint" runat="server" Image-Url="~/images/print.bmp" ToolTip="Printer Friendly Page">
</dx:ASPxButton>