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. Advertisements

  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. Advertisements

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. =?Utf-8?B?U2FjaGluIFZhaXNobmF2?=

    Accessing Session variables defined in ASP page in the ASPX page

    =?Utf-8?B?U2FjaGluIFZhaXNobmF2?=, Aug 17, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    1,667
    Rosanne
    Aug 17, 2005
  2. Krishna Chytanya

    Unable to use Activex control in Asp.Net 2.0

    Krishna Chytanya, Nov 1, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    395
    Krishna Chytanya
    Nov 1, 2007
  3. Replies:
    9
    Views:
    1,326
  4. japss
    Replies:
    0
    Views:
    676
    japss
    Jul 12, 2008
  5. Alexey Smirnov
    Replies:
    3
    Views:
    710
    Alexey Smirnov
    Oct 17, 2009
  6. Chuck
    Replies:
    0
    Views:
    400
    Chuck
    Jul 5, 2003
  7. Divya
    Replies:
    2
    Views:
    354
    Bullschmidt
    May 11, 2004
  8. Jake Barnes
    Replies:
    6
    Views:
    683
    9.co.uk
    Feb 8, 2006
Loading...