Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change http://something.com into a link at page load

Status
Not open for further replies.

Antithott

IS-IT--Management
Jan 20, 2006
90
DK
Hi,

I tried searching both google and Tek-tips, but didn't seem to get any good hits. I have seen a page before describing how to do this, but sadly i forgot to bookmark it.

what i would like to do is the following.
1. default.aspx gets requested
2. If default.aspx contains one or more keywords, Example: Cheat, then it should change Cheat into a link, to a predefined site.

I'm thinking its a Httpmodule maybe, but i'm stuck on how to actually do this, if anyone have some insight or have a link for a tutorial or explanation of how to parse the page html before sending it to the users browser i would be very happy.

Thanks in advance.
 
Yes, there's a couple of ways you could approach this. One that I've used in the past is to use Response Filters. Or, as you've said above you could use a httpModule.

Mark,

[URL unfurl="true"]http://lessthandot.com[/url] - Experts, Information, Ideas & Knowledge
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Website Design
[URL unfurl="true"]http://aspnetlibrary.com[/url] - An online resource for professional ASP.NET developers
 
Is there any pro's and con's between the 2 possibilities?

And thanks alot for both the links.
 
Well the response filter would run after any other httpModules have been run, so depending on what other processing you are doing, it may affect which one you choose to use.

Mark,

[URL unfurl="true"]http://lessthandot.com[/url] - Experts, Information, Ideas & Knowledge
[URL unfurl="true"]http://mdssolutions.co.uk[/url] - Website Design
[URL unfurl="true"]http://aspnetlibrary.com[/url] - An online resource for professional ASP.NET developers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top