Unable to use variables in asp page

S

scott cooper

I am trying to change text in the div tags of my page with values from an
object obtained from a server side script but the object is not accessable
to the client script. I get an object required error but I know the object
exists and is correct becuase I can write the query string value and
properties of the object with a server script. I also tried to access the
div tags from the server script but this also resulted in an object required
error.

<body>
<%
sLdapStr = request.QueryString("ldapurl")
set usrobj = GetObject(sLdapStr)
%>

<div id=oFirstName>label1</div><br>
<div id="oLastName">label2</div><br>
<div id="oEmpNum">label3</div><br>

<%
sLdapStr = request.QueryString("ldapurl")
response.Write sldapstr & "<br>"
response.Write usrobj.Get("givenName")
%>

<script language=vbscript>
oFirstName.InnerText = usrobj.Get("givenName")
oLastName.InnerText = usrobj.Get("sn")
oEmpNum.InnerText = usrobj.Get("employeeID")
</script>
</body>
 
G

guyv

<%
..
%>

<script language=vbscript>
oFirstName.InnerText = <%=usrobj.Get("givenName")%>
oLastName.InnerText = <%=usrobj.Get("sn")%>
oEmpNum.InnerText = <%=usrobj.Get("employeeID")%>
</script>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top