473,568 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get HTML Content of a Local Page

Sam
Hi All,

Is it possible to get a web page content of one of my webpages using
relative path?

for example:

If I have a website which consists of 2 pages: testpage1.aspx and
testpage2.aspx and the testpage2.aspx requires that I pass some parameters
to populate its form. Now if I want to get the html content of
"testpage2.aspx " page from testpage1's code behind page and store it in a
string variable, is it possible? I have been using HttpWebRequest and
HttpWebResponse objects to get the local page content but I just feel this a
bit awkward. Also the method "Create" of System.Net.WebR equest.class
requires a full url path to create a WebRequest object as in
System.Net.WebR equest.Create(u rl). Thanks in advance for your help.

Regards,

Sam
Nov 28 '06 #1
3 6632
WebRequest would have been my suggestion but you are already doing it.
Why do you need to retrieve the HTML from the page like this? What are
you doing with the HTML?

You can use a relative url if you pass it to the ResolveUrl function.
System.Net.WebR equest.Create(R esolveUrl(url))
Sam wrote:
Hi All,

Is it possible to get a web page content of one of my webpages using
relative path?

for example:

If I have a website which consists of 2 pages: testpage1.aspx and
testpage2.aspx and the testpage2.aspx requires that I pass some parameters
to populate its form. Now if I want to get the html content of
"testpage2.aspx " page from testpage1's code behind page and store it in a
string variable, is it possible? I have been using HttpWebRequest and
HttpWebResponse objects to get the local page content but I just feel this a
bit awkward. Also the method "Create" of System.Net.WebR equest.class
requires a full url path to create a WebRequest object as in
System.Net.WebR equest.Create(u rl). Thanks in advance for your help.

Regards,

Sam
Nov 28 '06 #2
Sam
Gozirra,

We have a page which allows users to print mulitple documents via popup
window at once by selecting checkbox beside them and the only way I can
think of right now is to have each of the pages' content saved to a string
and write to a popup
"Gozirra" <rm********@hot mail.comwrote in message
news:11******** *************@8 0g2000cwy.googl egroups.com...
WebRequest would have been my suggestion but you are already doing it.
Why do you need to retrieve the HTML from the page like this? What are
you doing with the HTML?

You can use a relative url if you pass it to the ResolveUrl function.
System.Net.WebR equest.Create(R esolveUrl(url))
Sam wrote:
>Hi All,

Is it possible to get a web page content of one of my webpages using
relative path?

for example:

If I have a website which consists of 2 pages: testpage1.aspx and
testpage2.as px and the testpage2.aspx requires that I pass some
parameters
to populate its form. Now if I want to get the html content of
"testpage2.asp x" page from testpage1's code behind page and store it in a
string variable, is it possible? I have been using HttpWebRequest and
HttpWebRespons e objects to get the local page content but I just feel
this a
bit awkward. Also the method "Create" of System.Net.WebR equest.class
requires a full url path to create a WebRequest object as in
System.Net.Web Request.Create( url). Thanks in advance for your help.

Regards,

Sam

Nov 28 '06 #3
I'd love to say that I have a great alternative solution for you but I
don't. I would have solved the problem in the same manner that you
are. I gave it some thought throughout the day and couldn't come up
with an alternative. As long as there are no performance problems or
any other issues, I believe the solution is pretty sound. Perhaps
someone else in the forums has a better suggestion.

Just to clarify, you are calling 1 - n different aspx pages in order to
retrieve the results for display and not static data correct? For
example, I want 2 reports for a given date range. The reports are
generated on the fly by 2 separate aspx pages. I call the pages with
the date parameters and the reports are generated on the fly. I
display the reports in the popup window after I append the results into
a single response.

Sam wrote:
Gozirra,

We have a page which allows users to print mulitple documents via popup
window at once by selecting checkbox beside them and the only way I can
think of right now is to have each of the pages' content saved to a string
and write to a popup
"Gozirra" <rm********@hot mail.comwrote in message
news:11******** *************@8 0g2000cwy.googl egroups.com...
WebRequest would have been my suggestion but you are already doing it.
Why do you need to retrieve the HTML from the page like this? What are
you doing with the HTML?

You can use a relative url if you pass it to the ResolveUrl function.
System.Net.WebR equest.Create(R esolveUrl(url))
Sam wrote:
Hi All,

Is it possible to get a web page content of one of my webpages using
relative path?

for example:

If I have a website which consists of 2 pages: testpage1.aspx and
testpage2.aspx and the testpage2.aspx requires that I pass some
parameters
to populate its form. Now if I want to get the html content of
"testpage2.aspx " page from testpage1's code behind page and store it in a
string variable, is it possible? I have been using HttpWebRequest and
HttpWebResponse objects to get the local page content but I just feel
this a
bit awkward. Also the method "Create" of System.Net.WebR equest.class
requires a full url path to create a WebRequest object as in
System.Net.WebR equest.Create(u rl). Thanks in advance for your help.

Regards,

Sam
Nov 28 '06 #4

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

Similar topics

11
8107
by: alex | last post by:
Hi, I am looking for a way to populate an HTML table from an external local text file which looks like this: DATE/TIME LAT. LON. DEPTH. ML. -------------------- ---------- ---------- ------- ------- 21/03/2005-04:06:03 XX,XX XX,XX 171 3,42 21/03/2005-12:23:53 XX,XX ...
4
1486
by: Jim Rudnick | last post by:
I am generating a report in HTML, that my users can look over AND if they want to, store in their own Access dbase. Thing is, I do not know how to "read" that whole html page into a var and store same in a field in Access. Can anyone point me here? Jim
195
8389
by: Torbjørn Pettersen | last post by:
As you might have noticed I'm trying to clean up my web site's HTML code. The way I do it is simply more or less redoing to complete site, testing it on a web server I have set up on my local network. I have downloaded, and installed CSE HTML Validator Pro, but I don't get the same results with that as I do with the online validator on...
6
5485
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp; DataBinder.Eval(Container.DataItem,"StoreEmail") &amp; "&amp;Subject=" &amp; DataBinder.Eval(Container.DataItem,"ProductName") ....
15
4733
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is...
82
6255
by: Eric Lindsay | last post by:
I have been trying to get a better understanding of simple HTML, but I am finding conflicting information is very common. Not only that, even in what seemed elementary and without any possibility of getting wrong it seems I am on very shaky ground . For example, pretty much every book and web course on html that I have read tells me I must...
12
2240
by: Nalaka | last post by:
Hi, I suddenly started getting a lot of errors from html validation (some CSS) so I followed the following instructions to disable it. If you'd rather not have these types of HTML validation errors show up in your error-list, you can disable this functionality by selecting the Tools->Options menu item in VS or Visual Web Developer. ...
13
1894
by: Ray Muforosky | last post by:
Hello all: Task: I want to do file search, using the "conatining text" option from a web page. How do I search for a file on my local drive containing a certain string, from a web page. That is, how do run the windows search program from a web page. Any help will be appreciated.
13
31375
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one outside of our domain, we get the error.. ** Client found response content type of 'text/html; charset=Windows-1252', but expected 'text/xml' **. We...
0
7693
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8118
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.