CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 ASP templates that display username in header

Print topic Send  topic

Author Message
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), ",", ".")

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.