ADSI/ASP: How to pass distinguishedName as hidden form field?

Discussion in 'ASP General' started by Bharat Suneja, Sep 10, 2004.

  1. [FOLLOW-UPS TO microsoft.public.scripting.vbscript]

    Hi All,

    I'm running into issues with passing the distinguishedName of a user as a
    hidden form field in a form from one page to the result page.

    Page 1: User enters user name in a form field

    Page 2: Queries AD, gets distinguishedName, binds to the user.
    Need to add more info to the user if attributes not present.
    Relevant portion of FORM:

    Response.Write("<B>ID: " & objUser.ID & "<Font color='Red'>not entered!
    </font></B>" & _
    "<FORM NAME='Form_Addid' ACTION='addid.asp' METHOD='post'>" & _
    "<INPUT TYPE='text' NAME='inputId' SIZE=5 MAXLENGTH=6><br>" & _
    "<INPUT TYPE='hidden' NAME='Username' value=" & objUser.sAMAccountName &
    ">" & _
    "<INPUT TYPE='hidden' NAME='UserDN' value=" & objUser.distinguishedName &
    ">" & _
    "<INPUT TYPE='submit' NAME='Submit_id' value='Add ID'></FORM>")

    Page 3: Process form from prevoius page, populate attributes for the same
    user.
    Relevant portions of ASP code to get user's details from previous page.

    <%
    strUsername=Request.Form("Username")
    strUserDN = Request.Form("UserDN")
    Response.Write("Username: " & strUsername)
    Response.Write("Distinguished Name" " & strUserDN)
    %>

    Questions:
    i) Can the user bind on Page 2 be carried over to page 3 so there's no need
    to search and bind to the user again?
    ii) If not, can the distinguishedName be passed on to Page 3 (like I'm
    trying to do) to eliminate the search portion and simply bind to the
    distinguishedName?

    When I try to pass the distinguishedName to Page 3 as a hidden form field,
    and display the field using Response.Write - I only get a partial
    distinguishedName - just the CN portion.
    sAMAccountName seems to be passing without any issues (but then I'd need to
    search and bind again based on that).

    Thanks,
    Bharat Suneja
    Bharat Suneja, Sep 10, 2004
    #1
    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. Rick
    Replies:
    3
    Views:
    8,092
    Alexey Smirnov
    Apr 13, 2010
  2. NotGiven
    Replies:
    3
    Views:
    331
    Michael D. Kersey
    May 13, 2004
  3. GavMc
    Replies:
    4
    Views:
    310
    Evertjan.
    Sep 22, 2005
  4. NotGiven
    Replies:
    3
    Views:
    290
    Michael D. Kersey
    May 13, 2004
  5. Replies:
    1
    Views:
    255
Loading...

Share This Page