473,386 Members | 1,803 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 1118
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.