473,396 Members | 1,599 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,396 software developers and data experts.

Width property is lost when using the GetResponseStream() function

I'm using the next code to get the source code from a web page and save it to
disk, all works fine except that the width property is lost:

wrRequest = (HttpWebRequest)HttpWebRequest.Create("www.server. com/page.aspx");
wrResponse = (HttpWebResponse)wrRequest.GetResponse();
srReader = new StreamReader(wrResponse.GetResponseStream());
sHTML = srReader.ReadToEnd();

why this error if when I see the web page from the server it works ok?

in the source code from IE directly from the page of the web server, the
input tag is as follow:

<input name="NAME" type="text" value="VALUE" id="IDNAME" disabled="disabled"
style="width:368px;" />

but in the source code from the page saved in local disk the input tag is:

<input name="NAME" type="text" value="VALUE" id="IDNAME" disabled="disabled"
/>

the style="width:368px;" property doesn't apear, any help?
Nov 16 '05 #1
2 1309

"Andres Romero" <An**********@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.com...
I'm using the next code to get the source code from a web page and save it
to
disk, all works fine except that the width property is lost:

wrRequest =
(HttpWebRequest)HttpWebRequest.Create("www.server. com/page.aspx");
wrResponse = (HttpWebResponse)wrRequest.GetResponse();
srReader = new StreamReader(wrResponse.GetResponseStream());
sHTML = srReader.ReadToEnd();

why this error if when I see the web page from the server it works ok?

in the source code from IE directly from the page of the web server, the
input tag is as follow:

<input name="NAME" type="text" value="VALUE" id="IDNAME"
disabled="disabled"
style="width:368px;" />

but in the source code from the page saved in local disk the input tag is:

<input name="NAME" type="text" value="VALUE" id="IDNAME"
disabled="disabled"
/>

the style="width:368px;" property doesn't apear, any help?


The web server is probably sniffing your "browser" and sending you downlevel
HTML.

Try adding

request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
..NET CLR 1.1.4322)"

David
Nov 16 '05 #2


"David Browne" wrote:

"Andres Romero" <An**********@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.com...
I'm using the next code to get the source code from a web page and save it
to
disk, all works fine except that the width property is lost:

wrRequest =
(HttpWebRequest)HttpWebRequest.Create("www.server. com/page.aspx");
wrResponse = (HttpWebResponse)wrRequest.GetResponse();
srReader = new StreamReader(wrResponse.GetResponseStream());
sHTML = srReader.ReadToEnd();

why this error if when I see the web page from the server it works ok?

in the source code from IE directly from the page of the web server, the
input tag is as follow:

<input name="NAME" type="text" value="VALUE" id="IDNAME"
disabled="disabled"
style="width:368px;" />

but in the source code from the page saved in local disk the input tag is:

<input name="NAME" type="text" value="VALUE" id="IDNAME"
disabled="disabled"
/>

the style="width:368px;" property doesn't apear, any help?


The web server is probably sniffing your "browser" and sending you downlevel
HTML.

Try adding

request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
..NET CLR 1.1.4322)"

David

Nov 16 '05 #3

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

Similar topics

7
by: R0bert Nev1lle | last post by:
Internet Explorer always presents me with a challenge (partial repost). The current issue involves emulating max-width in IE using the technique described by Svend Tofte. ...
3
by: Phil Powell | last post by:
<script type="text/javascript"> <!-- function getWinWidth() { isNav = (document.all) ? false : true; isIE = (document.all) ? true : false; if (isNav && !isIE) return(window.innerWidth); else...
3
by: coolsti | last post by:
I need some help here. I am making an application which allows a user to look at a series of picture files one at a time, and enter the outcome of various visual tests to a database. The...
3
by: WStoreyII | last post by:
I have a Collection Class That I am Creating , In This Collection Class I have a default Property Item. My Problem is this I have about twenty different Criterias that can be used as a value...
3
by: yxq | last post by:
Hello, I use the com component "shockwave flash object" to play flash file, but how to get the actual size (width*height) of flash file but no control size? thank you!
3
by: Grzegorz ¦lusarek | last post by:
Hi all. I have situation that when my page is loaded i create js object <html> ... <script> function Page() { this.page = 0; this.result = 0 this.resultCount =1; this.currentPage =1; }
2
by: Atul | last post by:
I am unable to find image height and width in mozilla firefox. My code is working in IE but not in Mozilla. How can i find image width and height in mozilla? function check(sel) { if(sel != "")...
2
by: paul | last post by:
I have a JS function to change the width of a <divthat works great in Firefox, but not at all in IE7. In IE an error message occurs: Line: 92 Char: 5 Error: Invalid Argument Code: 0 Firefox...
3
by: shapper | last post by:
Hello, I am trying to convert some of my old VB.NET code to C# using an online tool but I am getting an error: Default Public Overloads Property Item(ByVal index As Integer) As Element Get...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.