Posts

Showing posts from February, 2009

Set FileUpload control in ASP.Net 2.0 to Read-Only?

We can make the ASP.Net FileUpload control readonly by setting the ContentEditable property to false. <asp:FileUpload ID="fileUploadSri" ContentEditable="false" runat="server" /> The other way of achieving it by restricting users to type in any characters i.e. return false on key press, key up and on paste event to prevent users pasting any values directly. Refer the below code snippet that helps in doing that, fileUploadSri.Attributes.Add("onkeypress", "return false;"); fileUploadSri.Attributes.Add("onkeyup", "return false;"); fileUploadSri.Attributes.Add("onpaste", "return false;");

Uploading Files using FileUpload control in Update Panel in ASP.Net AJAX

By default, FileUpload control will not work inside an UpdatePanel control for uploading files using Asynchronous postback. This is because, the file uploading and file manipulations is restricted by default in client side for security reasons. Hence it is not possible to upload files using asynchronous postback in UpdatePanel. To upload files inside UpdatePanel control we need to rely upon a standard postback i.e. we need to set the button that is uploading the file to be PostBack trigger instead of AsyncPostBack trigger. This will initiate a normal postback whenever we click the upload button and it is possible to upload the file. Refer the below code for clear understanding, <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:FileUpload ID="fuUpload" runat="server" /> <asp:Button ID="btnUpload" runat="server" OnClick="bt

Windows 7 - Next OS

Windows 7 , the next client release of Microsoft will be available in 32 & 64-bit versions. Here are some things that you asked for in your Desktop OS: For end –users 1. Faster-Your system starts up, shuts down and resumes from standby faster, and your laptop’s battery lasts longer! 2. Touch- Multi touch, ink and gesture support along with handwriting recognition allow you to create exciting new input capabilities. Managing large number of windows is much easier, with intuitive touch gestures to view multiple windows at once and remove unwanted windows. 3. Faster Browsing- Build for the web with IE8, add rich media with Silver light and extend to rich client with WPF – using the same platform and tools 4. Explore and Share - With Windows 7 and Windows Live, you can easily manage your documents, pictures, movies and music, regardless of which PC they are stored on, and share them with your friends and family. 5. Search- Windows 7 includes all performance improvements from Windows Se

Probable Timeout problems in ASP.NET

I've been through almost all sorts of Timeout related issues with Asp.net web service development. I’d like put a check list here to remind myself and hopefully save some headache of yours. If use database, you may get ‘ System.Data.SqlClient.SqlException: Timeout expired ’: a: Check your connection string setting for ‘Connect Timeout’: I.e. connectionString="Data Source=SNYC14D11511;Initial Catalog=d_dbivt003;Persist Security Info=True;User ID= user;Password= Password; Connect Timeout=4200 b:Check your command object SqlCommand.CommandTimeout Property, it’s by default 30s Check you Web.config setting when you get error like ‘Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.’: …. executionTimeout="1200"/ > make sure your set 'compilation debug="false" as well to let timeout setting take effect. Check MSDN for details. Set your proxy class Timeout property (derived