Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


How do I open a link in a new page using ASP.NET C#

Posted on 2009-04-28
Medium Priority
Last Modified: 2013-12-17
I need to amend an old application that was written using c# asp.net 1.1 framework. I have the attached image button that I want to link to a url that opens in a new page. I tried Response.Redirect but I can't seem to get the url to open in a new page? Can anyone help?
<asp:imagebutton id="imgClientStandardRates" runat="server" ImageUrl="../img/AR Status/x.gif"></asp:imagebutton>
private void imgClientStandardRates_Click(object sender, System.Web.UI.ImageClickEventArgs e)

Open in new window

Question by:Shepwedd
LVL 33

Accepted Solution

Todd Gerbert earned 2000 total points
ID: 24250672
Use a HyperLink instead of an ImageButton, then set the ImageUrl property of the HyperLink and it should show up as a clickable image, instead of an underlined text link.  Then you can set the Target property to "_blank."

Is the code you wrote above all that needs to happen when this object is clicked?
LVL 26

Expert Comment

by:Anurag Thakur
ID: 24250687
Response.Redirect("http://www.google.com", false);

Author Comment

ID: 24250935

yip, upon clicking the image I just want to navigate to a url but within a new page. Your solution worked, thanks!


your solution didn't make any difference.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question