473,486 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Getting access to a page's entire html source

Hi,

Is it possible to gain access to the actual html stream send to the client?
I am thinking of something like:

private void Page_Load(object sender, System.EventArgs e)

{

if ( !Page.IsPostBack )

{

// do stuff

Bind_Grid()

Get_Html_Stream()

}

}
Nov 19 '05 #1
2 1078
One was is to use a new instance of the Webclient class. See the VB.NET code
below.

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]
Toronto

Sub DoPost()
Dim uriString As String = _
"http://" & _
Request.ServerVariables("SERVER_NAME") & _
Request.ServerVariables("SCRIPT_NAME")
' Create a new WebClient instance.
Dim myWebClient As New System.Net.WebClient
Dim myNameValueCollection As New _
System.Collections.Specialized.NameValueCollection
Dim responseArray As Byte() = myWebClient.UploadValues _
(uriString, "POST", myNameValueCollection)
Label1.Text = _
Server.HtmlEncode _
(System.Text.Encoding.ASCII.GetString(responseArra y))
End Sub

Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
Call DoPost()
End Sub

<form id="Form1" method="post" runat="server">
<p>
<asp:label id="Label1" runat="server">Label</asp:label></p>
<p>
<asp:button id="Button1" runat="server"
Text="Button"></asp:button></p>
</form>

"msnews.microsoft.com" <ji***@hotmail.com> wrote in message
news:um**************@TK2MSFTNGP15.phx.gbl...
Hi,

Is it possible to gain access to the actual html stream send to the
client? I am thinking of something like:

private void Page_Load(object sender, System.EventArgs e)

{

if ( !Page.IsPostBack )

{

// do stuff

Bind_Grid()

Get_Html_Stream()

}

}


Nov 19 '05 #2
What are you trying to do? You can always access the underlying stream via
Response.OutputStream.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Hi,

Is it possible to gain access to the actual html stream send to the
client? I am thinking of something like:

private void Page_Load(object sender, System.EventArgs e)

{

if ( !Page.IsPostBack )

{

// do stuff

Bind_Grid()

Get_Html_Stream()

}

}


Nov 19 '05 #3

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

Similar topics

5
29425
by: Kathryn | last post by:
Good morning! I am having a problem with a span. I have items, of which I only want to show the first X characters on the screen. If the user prints the page, I want the entire item to print....
0
1899
by: Jim | last post by:
I need some help getting started with a .NET web project for a commercial site. I am new to .NET and my understanding of some (but not all) of its concepts is a little sparse. I apologize for the...
0
1878
by: Jim | last post by:
This si a repost, I apologize but perhaps my original inquiry got buried under all the usenet spam... I need some help getting started with a .NET web project for a commercial site. I am new to...
11
1939
by: Brett | last post by:
In Yahoo mail, I click the Inbox link and see my messages. If I view source, I don't have HTML which contains the URL of each message. The source HTML contains javascripting and framesets. This...
6
13928
by: john_williams_800 | last post by:
Hi; I am writing an html page that will live on one server in an ms windows network, but access pictures from a directory on another ms windows server in the network. I know in html the...
17
4382
by: Mell via AccessMonster.com | last post by:
Is there a way to find out where an application was created from? i.e. - work or home i.e. - if application sits on a (work) server/network, the IT people know the application is sitting...
9
3813
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web...
13
1850
by: Ørjan Langbakk | last post by:
I wanna make a file that holds the complete pricelist for a small webshop (yes, I know that a database in the background would be a lot simpler, but that is not an option today, unfortunately). ...
27
8698
by: Steve | last post by:
My apologies if this is a duplicate post, I can't find the earlier version of my question. I have a DIV that uses a CSS class defined at the thtop of an HTML page. The height and width of the...
0
7123
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
7173
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
5427
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,...
1
4863
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
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
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 ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
259
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...

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.