We can make the ASP.Net FileUpload control readonly by setting the ContentEditable property to false.
in .aspx file write.... fileupload id="fileUpload1" runat="server" contenteditable="false"
note : intellisence won't shows ContentEditable property.
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;");
Friday, June 19, 2009
Subscribe to:
Comments (Atom)
