Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Getting access to a page's entire html source

Reply
Thread Tools

Getting access to a page's entire html source

 
 
msnews.microsoft.com
Guest
Posts: n/a
 
      04-03-2005
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()



}

}


 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      04-03-2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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()
>
>
>
> }
>
> }
>
>


 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      04-03-2005
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()
>
> }
>
> }
>




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting the entire document from response. Josh Naro ASP .Net 1 06-20-2007 04:31 PM
scanf not getting entire long value Sib C Programming 6 05-18-2005 03:46 PM
Accessing entire Web Form HTML Source Shawn Berg ASP .Net 2 02-03-2005 09:30 PM
is there a way to "include" source file B.html in source file A.html? Cloud Burst HTML 11 01-09-2004 02:49 AM



Advertisments