This topic is locked
[SOLVED]

 Field value in page title?

10/13/2009 12:20:05 PM
ASPRunnerPro General questions
author

Is there a way to put the userid value in the page title on the edit and add pages? Not critical, just a nice touch. Thanks.

C
clig 10/13/2009



Is there a way to put the userid value in the page title on the edit and add pages? Not critical, just a nice touch. Thanks.


not sure which version you are using but you might be able to edit the edit/add templates and regenerate (I use 5.2)
you could try adding <%= Session("UserID") %> to <head><title>##strCaption h##</title> in edit.htm / add.htm ...
I haven't tried this particular customization myself...
Here's a sample header I use in header.asp in one application using a similar idea just not in the title:
<table width="100%"align="center" cellpadding="0" cellspacing="0" title="NTSS - National CPS Incident Management, Problem Management and Document Management Support System" style="background:#FFFFFF">

<td align="left" width="100%"></td>

</table>

<table width="100%" align="center" cellpadding="4" cellspacing="0">

<tr>

<td style="background:#FFFFFF url('/NTSS/TNSImages/bg_left.gif') no-repeat"></td>

<td align="left" style="background:#FFFFFF url('/NTSS/TNSImages/bg.gif') repeat-x"><b>|</b>&nbsp;<a href="/"><font size="1" color="white" face="Tahoma" style="font-weight:bold">NTSS</font></a><b>&nbsp;|</b></td>

<td width="100%" align="right" style="background:#FFFFFF url('/NTSS/TNSImages/bg.gif') repeat-x"><b>|</b>&nbsp;<font size="1" color="white" face="Tahoma" style="font-weight:bold">Session Expires:&nbsp;[<%= DateAdd("n", 60, Now()) %>]</font></a></td>

<td align="right" style="background:#FFFFFF url('/NTSS/TNSImages/bg.gif') repeat-x"><b>|</b>&nbsp;<a href="/NTSS/NTSS_USERS_list.asp?a=search&value=1&SearchOption=Equals&SearchField=LoginName&SearchFor=<%= Session("UserID") %>"><font size="1" color="white" face="Tahoma" style="font-weight:bold">[<%= Session("UserID") %>]</font></a></td>

<td align="right" style="background:#FFFFFF url('/NTSS/TNSImages/bg.gif') repeat-x"><b>|</b>&nbsp;<a href="/NTSS/Help.htm" target="_blank"><font size="1" color="white" face="Tahoma" style="font-weight:bold">[FAQ]</font></a><b>&nbsp;|</b></td>

<td style="background:#FFFFFF url('/NTSS/TNSImages/bg_right.gif') no-repeat"></td>

</tr>

</table>

500472 10/13/2009

Thanks! I'll give it a try. I am using 6.1.



not sure which version you are using but you might be able to edit the edit/add templates and regenerate (I use 5.2)
you could try adding <%= Session("UserID") %> to <head><title>##strCaption h##</title> in edit.htm / add.htm ...
I haven't tried this particular customization myself...
Here's a sample header I use in header.asp in one application using a similar idea just not in the title:
<table width="100%"align="center" cellpadding="0" cellspacing="0" title="NTSS - National CPS Incident Management, Problem Management and Document Management Support System" style="background:#FFFFFF">

<td align="left" width="100%"></td>

</table>

<table width="100%" align="center" cellpadding="4" cellspacing="0">

<tr>

<td style="background:#FFFFFF url('/NTSS/TNSImages/bg_left.gif') no-repeat"></td>

<td align="left" style="background:#FFFFFF url('/NTSS/TNSImages/bg.gif') repeat-x"><b>|</b>&nbsp;<a href="/"><font size="1" color="white" face="Tahoma" style="font-weight:bold">NTSS</font></a><b>&nbsp;|</b></td>

<td width="100%" align="right" style="background:#FFFFFF url('/NTSS/TNSImages/bg.gif') repeat-x"><b>|</b>&nbsp;<font size="1" color="white" face="Tahoma" style="font-weight:bold">Session Expires:&nbsp;[<%= DateAdd("n", 60, Now()) %>]</font></a></td>

<td align="right" style="background:#FFFFFF url('/NTSS/TNSImages/bg.gif') repeat-x"><b>|</b>&nbsp;<a href="/NTSS/NTSS_USERS_list.asp?a=search&value=1&SearchOption=Equals&SearchField=LoginName&SearchFor=<%= Session("UserID") %>"><font size="1" color="white" face="Tahoma" style="font-weight:bold">[<%= Session("UserID") %>]</font></a></td>

<td align="right" style="background:#FFFFFF url('/NTSS/TNSImages/bg.gif') repeat-x"><b>|</b>&nbsp;<a href="/NTSS/Help.htm" target="_blank"><font size="1" color="white" face="Tahoma" style="font-weight:bold">[FAQ]</font></a><b>&nbsp;|</b></td>

<td style="background:#FFFFFF url('/NTSS/TNSImages/bg_right.gif') no-repeat"></td>

</tr>

</table>

Sergey Kornilov admin 10/13/2009

http://www.xlinesoft.com/asprunnerpro/docs/smarty_templates.htm
In template file define a variable:

<head><title>{mytitle}</title>
In BeforeProcess event populate it:

xt.assign "mytitle", "Whatever you need"
If required you can query your database in BeforeProcess event and retrieve data from there.

500473 10/13/2009

Interesting! I have a field in the print page query called "bill." How would I query the BeforeProcess event to retrieve the "Bill" field data and drop that into the page title? Thanks.



http://www.xlinesoft.com/asprunnerpro/docs/smarty_templates.htm
In template file define a variable:

<head><title>{mytitle}</title>
In BeforeProcess event populate it:

xt.assign "mytitle", "Whatever you need"
If required you can query your database in BeforeProcess event and retrieve data from there.

J
Jane 10/14/2009

Hi,
you can query bill field in the Before SQL query event:

Set rstmp = dal.TableName.Query(strWhereClause,"")

Session("FieldName") = rstmp("FieldName")

rstmp.close

set rstmp=nothing



Then add Before display event:

xt.assign "mytitle", "Whatever you need" & Session("FieldName")