Calling .ASP pages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joe Reazor

    #1

    Calling .ASP pages

    I know you can't use Server.Execute to call an ASP page, so I have tried
    using the HttpWebRequest and HttpWebResponse objects to do so. The trouble
    is that the asp page that I need to call is password protected. When I call
    GetResponse on the HttpWebRequest object I get the login page that a normal
    user would be redirected to. I am not sure how to work around this. Anyone
    have any thoughts?

    TIA
    ==============
    Joe Reazor
    Gorbel Inc.
    email: joerea AT gorbel DOT com


  • Andrew de la Harpe

    #2
    Re: Calling .ASP pages

    Try this article

    A
    "Joe Reazor" <joenospam@belg or.com> wrote in message
    news:%23PhPAJzn DHA.3316@tk2msf tngp13.phx.gbl. ..[color=blue]
    > I know you can't use Server.Execute to call an ASP page, so I have tried
    > using the HttpWebRequest and HttpWebResponse objects to do so. The[/color]
    trouble[color=blue]
    > is that the asp page that I need to call is password protected. When I[/color]
    call[color=blue]
    > GetResponse on the HttpWebRequest object I get the login page that a[/color]
    normal[color=blue]
    > user would be redirected to. I am not sure how to work around this.[/color]
    Anyone[color=blue]
    > have any thoughts?
    >
    > TIA
    > ==============
    > Joe Reazor
    > Gorbel Inc.
    > email: joerea AT gorbel DOT com
    >
    >[/color]


    Comment

    • Joe Reazor

      #3
      Re: Calling .ASP pages

      Thanks for the article. I pretty much figured all of this out already
      regarding the HttpWebRequest/Response objects. The one thing that the
      article does not address is forms based authentication. It has basic and
      ntlm but not forms based. I thought that I could somehow retrieve the
      cookie that the forms based authentication sets in my originating aspx page
      by getting the cookies from that page's Request object and then iterating
      through them to add them to the cookies of the HttpWebRequest object, but
      that doesn't seem to work. It keeps giving a very useless error that says
      nothing more than "cookie.domain" , which doesn't help me much. So I guess I
      am at a loss of how to do this.


      ==============
      Joe Reazor
      Gorbel Inc.
      email: joerea AT gorbel DOT com


      "Andrew de la Harpe" <andrew_dela@ho tmail.com> wrote in message
      news:eKQK0MznDH A.372@TK2MSFTNG P11.phx.gbl...[color=blue]
      > Try this article
      > http://west-wind.com/presentations/d...WebRequest.htm
      > A
      > "Joe Reazor" <joenospam@belg or.com> wrote in message
      > news:%23PhPAJzn DHA.3316@tk2msf tngp13.phx.gbl. ..[color=green]
      > > I know you can't use Server.Execute to call an ASP page, so I have tried
      > > using the HttpWebRequest and HttpWebResponse objects to do so. The[/color]
      > trouble[color=green]
      > > is that the asp page that I need to call is password protected. When I[/color]
      > call[color=green]
      > > GetResponse on the HttpWebRequest object I get the login page that a[/color]
      > normal[color=green]
      > > user would be redirected to. I am not sure how to work around this.[/color]
      > Anyone[color=green]
      > > have any thoughts?
      > >
      > > TIA
      > > ==============
      > > Joe Reazor
      > > Gorbel Inc.
      > > email: joerea AT gorbel DOT com
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Joe Reazor

        #4
        Re: Calling .ASP pages

        Nevermind. I figured this out. The issue was that the cookies contained in
        the Page.Request.Co okies object all had null Domain properties, but the
        HttpWebRequest. CookieContainer cookies needed to have a domain and the
        domain had to match the site that I was already logged into. To get this to
        work I simply used the Request.Url.Hos t property to get the host and set the
        domain for all the cookies I created to this value. And that did the trick,
        no errors and I didn't get the login page anymore.


        ==============
        Joe Reazor
        Gorbel Inc.
        email: joerea AT gorbel DOT com


        "Joe Reazor" <joenospam@belg or.com> wrote in message
        news:uQqIqw7nDH A.1004@TK2MSFTN GP09.phx.gbl...[color=blue]
        > Thanks for the article. I pretty much figured all of this out already
        > regarding the HttpWebRequest/Response objects. The one thing that the
        > article does not address is forms based authentication. It has basic and
        > ntlm but not forms based. I thought that I could somehow retrieve the
        > cookie that the forms based authentication sets in my originating aspx[/color]
        page[color=blue]
        > by getting the cookies from that page's Request object and then iterating
        > through them to add them to the cookies of the HttpWebRequest object, but
        > that doesn't seem to work. It keeps giving a very useless error that says
        > nothing more than "cookie.domain" , which doesn't help me much. So I guess[/color]
        I[color=blue]
        > am at a loss of how to do this.
        >
        >
        > ==============
        > Joe Reazor
        > Gorbel Inc.
        > email: joerea AT gorbel DOT com
        >
        >
        > "Andrew de la Harpe" <andrew_dela@ho tmail.com> wrote in message
        > news:eKQK0MznDH A.372@TK2MSFTNG P11.phx.gbl...[color=green]
        > > Try this article
        > > http://west-wind.com/presentations/d...WebRequest.htm
        > > A
        > > "Joe Reazor" <joenospam@belg or.com> wrote in message
        > > news:%23PhPAJzn DHA.3316@tk2msf tngp13.phx.gbl. ..[color=darkred]
        > > > I know you can't use Server.Execute to call an ASP page, so I have[/color][/color][/color]
        tried[color=blue][color=green][color=darkred]
        > > > using the HttpWebRequest and HttpWebResponse objects to do so. The[/color]
        > > trouble[color=darkred]
        > > > is that the asp page that I need to call is password protected. When[/color][/color][/color]
        I[color=blue][color=green]
        > > call[color=darkred]
        > > > GetResponse on the HttpWebRequest object I get the login page that a[/color]
        > > normal[color=darkred]
        > > > user would be redirected to. I am not sure how to work around this.[/color]
        > > Anyone[color=darkred]
        > > > have any thoughts?
        > > >
        > > > TIA
        > > > ==============
        > > > Joe Reazor
        > > > Gorbel Inc.
        > > > email: joerea AT gorbel DOT com
        > > >
        > > >[/color]
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...