Search

You searched for the word(s): userid:857486

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" />
  • 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
  • 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
Page 1 of 4 (37 items) 1 2 3 4 Next >