Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Unable to use variables in asp page

Reply
Thread Tools

Unable to use variables in asp page

 
 
scott cooper
Guest
Posts: n/a
 
      03-30-2005
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>



 
Reply With Quote
 
 
 
 
guyv
Guest
Posts: n/a
 
      03-30-2005
<%
..
%>

<script language=vbscript>
oFirstName.InnerText = <%=usrobj.Get("givenName")%>
oLastName.InnerText = <%=usrobj.Get("sn")%>
oEmpNum.InnerText = <%=usrobj.Get("employeeID")%>
</script>
------------------------------------------------------
Easy.
Just put server side variables into client script block.

-GuyV-



"scott cooper" <> wrote in message
news:...
> 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>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Put variables into member variables or function variables? tjumail@gmail.com C++ 9 03-23-2008 04:03 PM
unable to capture all the HTML of my page,or I'm unable to save it to disk Jake Barnes Javascript 6 02-08-2006 02:38 PM
Accessing Session variables defined in ASP page in the ASPX page =?Utf-8?B?U2FjaGluIFZhaXNobmF2?= ASP .Net 7 08-17-2005 07:46 PM
Re: Class public shared Variables vs. Application Variables in ASP.NET avnrao ASP .Net 0 05-07-2004 05:28 AM
Calling a html page from an asp page then returning to the next statement on the original asp page Chuck ASP General 0 07-05-2003 02:00 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57