Hi There,
I'm working on improving Search Engine Optimisation code for a website I'm working on which is built in asp.net c (sharp).
I usually work in classic asp, so I'm finding where to start with getting asp.net equivalent code from what I use with classic asp is very difficult, to say the least.
Basically, the code I'm trying to find code in asp.net for - grabs the filename from the address bar and uses if statements to replace the page title, keywords and descriptions with different content depending on which page it is on. I have the asp code below:
<%
function curPageName()
dim pagename
pagename = Request.ServerVariables("SCRIPT_NAME")
if inStr(pagename, "/") > 0 then
pagename = Right(pagename, Len(pagename) - instrRev(pagename, "/"))
end if
curPageName = pagename
end function
currentPage = curPageName()
%>
<%
if vPage = "Home" then
vDx = "Specialists in Income and Family Protection insurance. Our Lifestyle Protection Plan is a premiere product specifically tailored to Protect You and Those Dear To You. For a more in-depth view visit insurance1.co.nz"
vWords = "Insurance 1, Insurance One, New Zealand, insurance, Tony Wilson, income protection, disability protection, life cover, living assurance, family protection, asset protection"
vTitle = "Insurance 1 - Protecting You And Those Dear To You..."
end if
&>
Has anyone done something like this before in .net and may be able to shed a little light or does anyone know of any tutorials or code snippets that may help with this?
Any ideas would be greatly appreciated!
Cheers,
Chris