Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,
i made a website, and on that website i have many imagebutton.
on each time a click the imagebutton i want to call a function and after that it will be redirected to a different website( on different tab).
Is it possible?
How?
Posted

C#
protected void ImageButton1_Click(object sender, EventArgs e)
        {
            string url = "Frm_report.aspx?ID=1&cat=test";
            string fullURL = "window.open('" + url + "', '_blank', 'height=500,width=800,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no' );";
            Button1.Attributes.Add("OnClick", fullURL);
        }
 
Share this answer
 
Try below code in the Button Click Event

Page.ClientScript.RegisterStartupScript( this.GetType(),"Open","window.open('ReplacewithUrlHere','_blank');",true);
 
Share this answer
 

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



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