obtaining page title and filename

  • Thread starter Thread starter Michael Stumpo
  • Start date Start date
M

Michael Stumpo

Is there a way in ASP to retreive the filename and/or the
page title of a page and have a hidden field in a form
post that to a database similar to <%=date%>.

I have a helpdesk template for creating helpdesk
solutions and want the page title and filename obtained
when the user fills out a survey about the quality of the
helpdesk article.

-M
 
Hi Michael,
ASP doesn't know what a page title is - you could use file system object
and a regex to parse the page for <title></title> tags but much easier would
be to use javascript, eg
<input type="hidden" name="TitleField" value="">
<script type="text/javascript">
document.forms[0].TitleField.value=document.title;
</script>
to get the page url you can use asp
<input type="hidden" name="url"
value="<%=request.servervariables("script_name")%>">
or javascript
<input type="hidden" name="url" value="">
<script type="text/javascript">
document.forms[0].url.value=location.href;
</script>
 
Back
Top