473,466 Members | 1,462 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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
Jul 21 '05 #1
3 1120
Try this article
http://west-wind.com/presentations/d...WebRequest.htm
A
"Joe Reazor" <jo*******@belgor.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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

Jul 21 '05 #2
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" <an*********@hotmail.com> wrote in message
news:eK*************@TK2MSFTNGP11.phx.gbl...
Try this article
http://west-wind.com/presentations/d...WebRequest.htm
A
"Joe Reazor" <jo*******@belgor.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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


Jul 21 '05 #3
Nevermind. I figured this out. The issue was that the cookies contained in
the Page.Request.Cookies 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.Host 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" <jo*******@belgor.com> wrote in message
news:uQ**************@TK2MSFTNGP09.phx.gbl...
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" <an*********@hotmail.com> wrote in message
news:eK*************@TK2MSFTNGP11.phx.gbl...
Try this article
http://west-wind.com/presentations/d...WebRequest.htm
A
"Joe Reazor" <jo*******@belgor.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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



Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: qaz | last post by:
I have login links on a number of pages in my site. Some of the pages expect variables on the querystring. I want to be able to login from any of these pages. The login link redirects me to a...
1
by: minchu | last post by:
Hello, I have created a site using DreamWeaver and I have used some behaviors (mouseover, showhide layers etc.). Is it better to keep all the scripts used for mouseover, showhide layers in a .js...
0
by: Mike Collins | last post by:
I apologize for using this newsgroup for what seems like a VB6 question, but I did not see a newsgroup for VB6. I also think I may not have the C# code setup correctly for calling from VB6. If...
5
by: Mark Fox | last post by:
Hello, I have a page DoBatchWork.aspx that my web host's cron requests periodically. It currently calls another web page that does some batch processing. The code I am currently using in...
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
6
by: johnf401 | last post by:
I've got a VB .NET Web application that has several frames (for discussion sake, let's call them Form1.aspx and Form2.aspx). I want to be able to call a code module in Form2.aspx.vb from code...
3
by: Opa | last post by:
Hi , I have a form with javasript which launches a popup via the showModalDialog() method. I get the dialog to open, now I am trying to first get a reference to the calling form from the popup...
1
by: dcnicholls | last post by:
This is my first post to this forum: I use ASP occasionally but don't know a lot of it, and the Windows IIS was invented by MS to torture me :) So I'm not sure if this should be herre or on the IIS...
47
by: teju | last post by:
hi, i am trying 2 merge 2 projects into one project.One project is using c language and the other one is using c++ code. both are working very fine independently.But now i need to merge both...
47
by: mukeshrasm | last post by:
Hi I am calling two pages using Ajax Get_Pages.php and Get_Content.php from combo box. Both pages are displayed based on selection from combo box. Main problem is that it is not showing the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.