Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:857486
More Search Options
RSS Available
Matching Posts
WebClient.DownloadData() and date format
Hello all, I'am trying to get the HTML code of a page using the DownloadData() method of WebClient class: private string GetPageContent(string url) { System.Net.WebClient Http = new System.Net.WebClient(); byte[] pageContent = Http.DownloadData(url); return Encoding.Default.GetString(pageContent); } Everything is fine except date information. The date format in the original page is "dd/MM/yyyy" but the HTML code I'm retrieving is displaying date in "MM/dd/yyyy" format
Posted to
Web Forms
(Forum)
by
Paulo Florencio
on 9/14/2009
Re: Validation Summary won't work with return Confirm messge box
First, make sure EnableClientScript is enabled on your validation controls. If it doesn't fire automatically, you can force client-side validation by using the client-side method Page_ClientValidate() and you can check if page is valid with Page_IsValid. Something like this: Page_ClientValidate(); if(Page_IsValid){ return confirm('Are you sure') } See ya
Posted to
Web Forms
(Forum)
by
Paulo Florencio
on 9/14/2009
Re: WebClient.DownloadData() and date format
Hello, Thanks for your reply but your solution doesn't solve my problem. I'm not dealing with a single datetime string, but with a page's entire HTML code. And within that code there are some datetime strings. It seems that when I use the DownloadData() method, the HTML code is automatically converted using a different culture info (which has date format MM/dd/yyyy), losing the original one (dd/MM/yyyy). I'm using Regex to solve the issue: byte[] pageContentByte = Http.DownloadData
Posted to
Web Forms
(Forum)
by
Paulo Florencio
on 9/14/2009
Re: WebClient.DownloadData() and date format
Hello mendhak, Thanks. I followed your suggestion and when I open the url in IE, Fiddler2 indicates the language as pt-br (brazilian portuguese). But I don't know where can I setup the language in my application to make DownloadData() retrieve the correct HTML format. I tried to add the globalization tag in web.config but without success. Any ideas?
Posted to
Web Forms
(Forum)
by
Paulo Florencio
on 9/14/2009
Re: FileUploading large files is causing a problem...
There is a request length limitation because of security problems like "Denial of Service" attacks. Probably your request is exceeding that limit. You can raise it in web.config <system.web> <httpRuntime maxRequestLength="60000" useFullyQualifiedRedirectUrl="true" executionTimeout="45"/> </system.web> For example, the code below allows requests up to 60MB. If you need this only to a single page, try use location tag <location path="yoursite
Posted to
Web Forms
(Forum)
by
Paulo Florencio
on 9/14/2009
Re: WebClient.DownloadData() and date format
OK mendhak. I got it. Fiddler showed me this header parameter in the request: "Accept-Language: pt-br" Then I added it in the headers collection of the Web Client and it worked. System.Net.WebClient Http = new System.Net.WebClient(); Http.Headers.Add("Accept-Language", "pt-br"); Thanks again
Posted to
Web Forms
(Forum)
by
Paulo Florencio
on 9/14/2009
Re: Can I internationalize a CalendarExtender?
Yes, you can. Just add the Globalization tag in your web.config or configure culture settings directly on a specific page ( http://msdn.microsoft.com/en-us/library/bz9tc508.aspx ) and make sure your Ajax ScriptManager has the EnableScriptGlobalization and EnableScriptLocalization set to true as below: <asp:ScriptManager ID="ScriptManager" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true" />
Posted to
ASP.NET AJAX Control Toolkit
(Forum)
by
Paulo Florencio
on 9/14/2009
Re: Excel file is not opening on IE
It worked. Thank you!
Posted to
Client Side Web Development
(Forum)
by
Paulo Florencio
on 9/13/2009
Excel file is not opening on IE
Hello all, I'm having trouble opening Excel files in my application. I'm simply firing a windows.open('<pathToFile>.xls') when the user clicks on a button. It works fine in my development enviromnment but when I deploy the app to the production server, this stops working. The new window opens up for a brief period of time and suddenly it closes while the file is still loading. Is this some security setting from the server? Is there another way that I can open the file? Thanks
Posted to
Client Side Web Development
(Forum)
by
Paulo Florencio
on 9/8/2009
Re: Excel file is not opening on IE
Hello Anfran Thanks for your reply. I've tried your suggestion but it didn't work for me. When I do the Response.BinaryWrite, the browser doesn't know the stream is an Excel file, thus showing it as sequence of unrecognizable characters. I was able to solve the automatic window closing problem by changing IE settings (Automatic prompting for file downloads = enabled), but I don't like this solution because it depends on user's action. And why only when accessing the production
Posted to
Client Side Web Development
(Forum)
by
Paulo Florencio
on 9/8/2009
Page 1 of 4 (37 items) 1
2
3
4
Next >
TechNet Edge:
Forefront Secure Endpoint Demo and Interview
ASP.NET:
Resizing images from the server using WPF/WIC instead of GDI+
Silverlight:
Deploying your Silverlight and WCF RIA Services application
Channel 9:
Juan Chen and Nikhil Swamy: FINE, a Compiler for End-to-End Security Verification
Channel 10:
Get the Outlook Hotmail Connector Beta
Channel 10:
MSN to Launch New Lifestyle Site from Wonderwall Creator
Channel 10:
Behind the Windows 7 Startup Animation
Channel 9:
Reactive Extensions API in depth: CombineLatest
Channel 9:
C9 Lectures: Dr. Graham Hutton - Functional Programming Fundamentals Chapter 11 of 13
WindowsClient:
New WPF Showcase: Scrum Sprint Monitor
WindowsClient:
WPF/XAML helping VS2010 Extensibility
WindowsClient:
HTTP 403.9 with ADO.NET Data Services
WindowsClient:
xml syntax highlighting in Silverlight
Channel 9:
Channel 9 Emerges in China
WindowsClient:
Overlaying Icons on the Windows 7 Taskbar with WPF 4
Channel 9:
The Outlook calendar starts in 1601 - But Why?
ASP.NET:
Bytes by MSDN: Brad Abrams Interview with Billy Hollis: Silverlight 4, RIA Services and VS2010
Mix Online:
Pictures or it Didn't Happen
Channel 9:
Reactive Extensions API in depth: even more Zip
TechNet Edge:
SDL For Agile
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online