How to transfer variable from C# aspx page to the VBS asp page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abadona
    New Member
    • Apr 2008
    • 5

    How to transfer variable from C# aspx page to the VBS asp page

    Hi, I am using C# .aspx page to authenticate a user in AD environment. Then if the login is successful the user is redirected to the .asp VB script located at the same directory. The question that I want to ask is how do I transfer a variable Username to the VB script.

    In the previous iteration the VB script was using Windows authentication, to check the user. And I was asked to move everything to the form authentication. I have no problem with authentication I just need to find a way of how to get a variable across. I feel as if it something simple and banal but, my experience of asp/aspx is shady.

    The help will be greatly appreciated.
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    Can you pass the UserName variable in a querystring to your asp page?

    Nathan

    Comment

    • abadona
      New Member
      • Apr 2008
      • 5

      #3
      I tried doing this:
      Context.Items["MyVar"]=txtUser.Text;

      and in asp page:

      strFinalName = Session("MyVar" )

      to replace this:

      strFinalName = Request.ServerV ariables("AUTH_ USER") (my aspx page is handeling the authentication with forms methods, then redirects to asp page)

      Comment

      • nateraaaa
        Recognized Expert Contributor
        • May 2007
        • 664

        #4
        It is very difficult to pass a Session value from a .NET application to an asp page. It would be much less work to pass the value as a querystring and access it in the asp page with

        Request.Queryst ring

        Comment

        • abadona
          New Member
          • Apr 2008
          • 5

          #5
          Originally posted by nateraaaa
          It is very difficult to pass a Session value from a .NET application to an asp page. It would be much less work to pass the value as a querystring and access it in the asp page with

          Request.Queryst ring

          This is good, but I need to hide the varible from users.

          Comment

          • nateraaaa
            Recognized Expert Contributor
            • May 2007
            • 664

            #6
            I found a few examples that may help you.



            “Ya no somos lo suficientemente felices para pedir belleza; por el momento sólo deseamos lo útil. La sociedad va a pasar no sé cuántos siglos persiguiendo lo

            Comment

            • abadona
              New Member
              • Apr 2008
              • 5

              #7
              Error executing child request for ASPXTOASP.aspx.

              Thank you but this is what I get every time when i try to do server.transfer ....

              Comment

              Working...