AOA Forums AOA Forums AOA Forums Folding For Team 45 AOA Files Home Front Page Become an AOA Subscriber! UserCP Calendar Memberlist FAQ Search Forum Home


Go Back   AOA Forums > Software > Programming and Assembly Language

Programming and Assembly Language Please read this Topic's rules!!


Reply
 
LinkBack Thread Tools Rating: Thread Rating: 2 votes, 5.00 average.
  #1 (permalink)  
Old 8th October, 2011, 01:47 PM
Allan's Avatar
Member/Contributer
 
Join Date: September 2001
Location: Denmark
Posts: 7,914

ASP.NET C# issue

Hey guys, long time no see! I hope you are all doing well.

I have a puzzling problem with an ASP.NET C# homepage that I'm playing with. I hope that your suggestions can help me!

Basically, I just want to register clicks to external links on my website, and open up the URLs in a new window:
  1. A user clicks on a link to an external site
  2. Serverside code ensures that the click is registered in the database
  3. The browser opens up a new window (ie. _BLANK) with the URL of the link

Pretty simple, huh?

Now, the troublesome part is that in my aspx page I define the link as a LinkButton so I have the OnClick event to put my c# serverside code in, ie. could be something like:

Code:
<asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click" CssClass="linkbutton_style">LinkButton</asp:LinkButton>
In the aspx.cs page I then have:

Code:
protected void LinkButton1_Click(object sender, EventArgs e)
{

  //Do database stuff here

  Response.Redirect(HttpUtility.HtmlDecode(whatever-link));
}
The thing is, the Response.Redirect does not have the option to open up the link in a new window (ie. there is no way to do a _BLANK this way).

What to do?

What I really want is a control that lets me have an OnClick event AND give me the option of passing the user along to the other website in a new window. I've tried all sorts of standard controls.

I do NOT want to use javascript to open up a new window, since most browsers will come up with a notification of this nowadays - so this is not an option.

All suggestions are appreciated
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 8th October, 2011, 05:04 PM
danrok's Avatar
AOA Staff
 
Join Date: March 2003
Location: Great Britain
Posts: 18,917

Hi Allan!

Seems to be mention of this on this page, including using ResponseHelper.Redirect to specify a target:
Response.Redirect into a new window (with Extension Methods) - Infinities Loop

No idea if it works.
__________________
Desktop PC: AMD FX-8370E / Asus M5A99X Evo R2.0 Motherboard / 16GB DDR3 RAM / GeForce GTX 970
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 8th October, 2011, 08:16 PM
Allan's Avatar
Member/Contributer
 
Join Date: September 2001
Location: Denmark
Posts: 7,914

Quote:
Originally Posted by danrok View Post
Hi Allan!

Seems to be mention of this on this page, including using ResponseHelper.Redirect to specify a target:
Response.Redirect into a new window (with Extension Methods) - Infinities Loop

No idea if it works.
Thanks for the input, but by looking at the code it still appears to be a javascript solution, which isn't an option for me, I'm afraid.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12th October, 2011, 05:37 PM
danrok's Avatar
AOA Staff
 
Join Date: March 2003
Location: Great Britain
Posts: 18,917

Here's one for you. Bit off topic.

My friend is think of taking a holiday at the end of October, in Copenhagen.

His teenage son refuses to go anywhere hot

Is there much on for tourists at that time, in Copenhagen?
__________________
Desktop PC: AMD FX-8370E / Asus M5A99X Evo R2.0 Motherboard / 16GB DDR3 RAM / GeForce GTX 970
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 13th October, 2011, 05:44 PM
Allan's Avatar
Member/Contributer
 
Join Date: September 2001
Location: Denmark
Posts: 7,914

I hardly ever go to Copenhagen, but I'm sure there will be lots to do any time of year. I think you should have them check out:
VisitCopenhagen visitcopenhagen.com - book hotel in Copenhagen, holiday in Copenhagen, city break, Visit Copenhagen, cheap accommodation, see and do in Copenhagen
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 13th October, 2011, 06:54 PM
danrok's Avatar
AOA Staff
 
Join Date: March 2003
Location: Great Britain
Posts: 18,917

OK, thanks!
__________________
Desktop PC: AMD FX-8370E / Asus M5A99X Evo R2.0 Motherboard / 16GB DDR3 RAM / GeForce GTX 970
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
8rda6+pro fsb issue ulozas EPoX MotherBoards 4 11th January, 2006 09:21 PM
Please help - XP2500 issue sacrum AMD Motherboards & CPUs 1 30th October, 2003 04:25 AM
4PEA+ and USB issue Mr Twister EPoX MotherBoards 3 27th January, 2003 01:16 AM
Volcano 7 RPM Issue Ricochet EPoX MotherBoards 3 26th January, 2003 04:00 PM
2600 / 333 OC Issue Difranco EPoX MotherBoards 1 20th January, 2003 09:45 PM


All times are GMT +1. The time now is 04:30 AM.


Copyright ©2001 - 2010, AOA Forums
Don't Click Here Don't Click Here Either

Search Engine Friendly URLs by vBSEO 3.3.0