Unable to use variables in asp page

Discussion in 'ASP General' started by scott cooper, Mar 30, 2005.

  1. scott cooper

    scott cooper Guest

    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>
    scott cooper, Mar 30, 2005
    #1
    1. Advertising

  2. scott cooper

    guyv Guest

    <%
    ..
    %>

    <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>
    >
    >
    >
    guyv, Mar 30, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Krishna Chytanya

    Unable to use Activex control in Asp.Net 2.0

    Krishna Chytanya, Nov 1, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    314
    Krishna Chytanya
    Nov 1, 2007
  2. Replies:
    9
    Views:
    931
  3. japss
    Replies:
    0
    Views:
    580
    japss
    Jul 12, 2008
  4. Alexey Smirnov
    Replies:
    3
    Views:
    534
    Alexey Smirnov
    Oct 17, 2009
  5. Jake Barnes
    Replies:
    6
    Views:
    381
    9.co.uk
    Feb 8, 2006
Loading...

Share This Page