Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Duplication of html generated from htmlwebresponse

Reply
Thread Tools

Duplication of html generated from htmlwebresponse

 
 
msnews.microsoft.com
Guest
Posts: n/a
 
      03-28-2005
AOA
I am using httpwebrequst and httwebresponse classes in order to execute an
html page. The html generaed is then emailed.
My problem is that
I am calling the GenerateHtmlText() method which is using httpwebrequst and
httwebresponse classes
This method is called in a loop
In first iteration it goes well. But in second iteration the html generated
contains the html generated in first iteration and
the html generated in second iteration but it should contain only the html
generated in second iteration.
I couldn't find out why the html generated in first iteration is placed in
the start of the html which is being generated in
the second iteration

example

forexample if html generated in first iteration is <br>
and html that should be in second iteration is <h1>
But the html generated in second iteration is

<br>
<h1>


Below is my code


For ind = 0 To 1
Dim objmail As New mail

searchid = ind
message = ""
message = objmail.GenerateHtmlText("CompPath",
"listingalert.aspx?sid=" & searchid)
...
Next


and GenerateHtmlText() method is written below

Public Function GenerateHtmlText(ByVal strKey As String, ByVal strPageName
As String, Optional ByVal strComm As String ) As String


Dim strurl As String
'Dim response As HttpWebResponse
Dim response As HttpWebResponse
Dim req As HttpWebRequest
'Dim req As WebRequest
Dim sr As StreamReader
Dim MessageBody As String
Dim newStream As Stream
Dim ind As Integer
Dim data As Byte()
Dim strdata As String
Dim uri As System.Uri


strurl = ConfigurationSettings.AppSettings(strKey) &
strPageName

req = CType(System.Net.HttpWebRequest.Create(strurl),
HttpWebRequest)

response = CType(req.GetResponse, HttpWebResponse)
sr = New StreamReader(response.GetResponseStream())
MessageBody = sr.ReadToEnd()
sr.Close()
Return MessageBody

end function


 
Reply With Quote
 
 
 
 
msnews.microsoft.com
Guest
Posts: n/a
 
      04-05-2005
AOA
I am using httpwebrequst and httwebresponse classes in order to execute an
html page. The html generaed is then emailed.
My problem is that
I am calling the GenerateHtmlText() method which is using httpwebrequst and
httwebresponse classes
This method is called in a loop
In first iteration it goes well. But in second iteration the html generated
contains the html generated in first iteration and
the html generated in second iteration but it should contain only the html
generated in second iteration.
I couldn't find out why the html generated in first iteration is placed in
the start of the html which is being generated in
the second iteration

example

forexample if html generated in first iteration is <br>
and html that should be in second iteration is <h1>
But the html generated in second iteration is

<br>
<h1>


Below is my code


For ind = 0 To 1
Dim objmail As New mail

searchid = ind
message = ""
message = objmail.GenerateHtmlText("CompPath",
"listingalert.aspx?sid=" & searchid)
...
Next


and GenerateHtmlText() method is written below

Public Function GenerateHtmlText(ByVal strKey As String, ByVal strPageName
As String, Optional ByVal strComm As String ) As String


Dim strurl As String
'Dim response As HttpWebResponse
Dim response As HttpWebResponse
Dim req As HttpWebRequest
'Dim req As WebRequest
Dim sr As StreamReader
Dim MessageBody As String
Dim newStream As Stream
Dim ind As Integer
Dim data As Byte()
Dim strdata As String
Dim uri As System.Uri


strurl = ConfigurationSettings.AppSettings(strKey) &
strPageName

req = CType(System.Net.HttpWebRequest.Create(strurl),
HttpWebRequest)

response = CType(req.GetResponse, HttpWebResponse)
sr = New StreamReader(response.GetResponseStream())
MessageBody = sr.ReadToEnd()
sr.Close()
Return MessageBody

end function



 
Reply With Quote
 
 
 
 
msnews.microsoft.com
Guest
Posts: n/a
 
      04-05-2005
AOA
I am using httpwebrequst and httwebresponse classes in order to execute an
html page. The html generaed is then emailed.
My problem is that
I am calling the GenerateHtmlText() method which is using httpwebrequst and
httwebresponse classes
This method is called in a loop
In first iteration it goes well. But in second iteration the html generated
contains the html generated in first iteration and
the html generated in second iteration but it should contain only the html
generated in second iteration.
I couldn't find out why the html generated in first iteration is placed in
the start of the html which is being generated in
the second iteration

example

forexample if html generated in first iteration is <br>
and html that should be in second iteration is <h1>
But the html generated in second iteration is

<br>
<h1>


Below is my code


For ind = 0 To 1
Dim objmail As New mail

searchid = ind
message = ""
message = objmail.GenerateHtmlText("CompPath",
"listingalert.aspx?sid=" & searchid)
...
Next


and GenerateHtmlText() method is written below

Public Function GenerateHtmlText(ByVal strKey As String, ByVal strPageName
As String, Optional ByVal strComm As String ) As String


Dim strurl As String
'Dim response As HttpWebResponse
Dim response As HttpWebResponse
Dim req As HttpWebRequest
'Dim req As WebRequest
Dim sr As StreamReader
Dim MessageBody As String
Dim newStream As Stream
Dim ind As Integer
Dim data As Byte()
Dim strdata As String
Dim uri As System.Uri


strurl = ConfigurationSettings.AppSettings(strKey) &
strPageName

req = CType(System.Net.HttpWebRequest.Create(strurl),
HttpWebRequest)

response = CType(req.GetResponse, HttpWebResponse)
sr = New StreamReader(response.GetResponseStream())
MessageBody = sr.ReadToEnd()
sr.Close()
Return MessageBody

end function



 
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
Visual Studio 2005 html-view does not recognize the generated html-tag of a custom control Rolf Welskes ASP .Net 3 10-06-2006 06:49 PM
HSRP mac duplication erros causing vlans configured to flap gurumurthy Cisco 6 02-14-2006 08:59 PM
straight html or dom generated html objects faster? anagai Javascript 1 01-02-2006 09:27 PM
[csv module] duplication of end of line character in output file generated simon.alexandre Python 3 01-11-2005 01:17 PM
duplication? ll ASP .Net 1 11-09-2003 09:18 AM



Advertisments