NEWTOCODECHRG
|
| Posted: 03/11/2002, 3:05 PM |
|
I am trying to display the logged in users name in the header at the top of the page but since I created the page as asp with templates it doesn't seem to work. I have done it succesfully in ASP w/o Templates. Why isn't it working? My guess is that my syntax is incorrect.
|
|
|
 |
Nicole
|
| Posted: 03/12/2002, 1:27 AM |
|
Hello,
as you know in template version html and asp code are in different files. Create template variable in page header section, e.g.
{user_name}
then substitute it with user name of logged in user using asp code like below. It should be located in lets say Open event of the page:
name = dLookUp("user_table_name", "user_name_field", "user_id=" & ToSQL(Session("UserID"), "Number"))
SetVar "user_name", "Hello " & name & "!"
|
|
|
 |
dava133
|
| Posted: 03/12/2002, 9:38 AM |
|
When I try this i get this error message :
Microsoft VBScript runtime error '800a01a8'
Object required: 'ParsedBlocks'
/TemplateObj.asp, line 65
any ideas?? cheers
|
|
|
 |
dava133
|
| Posted: 03/12/2002, 12:36 PM |
|
right now ive got the page displaying I have this in the header section :
Welcome, {UserName}
and this in the event open for the page:
If Session("UserRights") <> "" then
SetVar "UserName", dlookup("Address","FamilyName","FamilyID=" & session("UserID"))
end if
but for all users all i get is "Welcome, "
any ideas on what im doing wrong?? cheers
|
|
|
 |
NEWTOCODECHRG
|
| Posted: 03/12/2002, 2:26 PM |
|
Any ideas why I got an error? I gave me an error with the common.asp file in line 136. I know that doesn't tell you much but I forgot to get the code will add later. any ideas anyways?
|
|
|
 |
NEWTOCODECHRG
|
| Posted: 03/12/2002, 2:46 PM |
|
ToSQL = replace(CDbl(Param), ",", ".")
|
|
|
 |
|