ASP.NET File Upload Control - Force the user to browse

Posted by: Third  :  Category: ASP.NET, Javascript

The File Upload Control is used to let users upload local files to the server. There are two (2) ways to set the filename on this control ,

  1. By clicking the “Browse” button, and
  2. Manually type the filename on the textbox.

Option 1 ensures that the value set on the control exists and valid while Option 2 could not guarantee this since they maybe able to type an incorrect filename/filepath.

So how do you get a workaround on this issue?

Simply add the following code on the PageLoad event,

FileUpload1.Attributes.Add(”onkeydown”, “return false;”);

Populate password field in ASP.NET from code-behind

Posted by: Third  :  Category: ASP.NET

If you have a password field in ASP.NET (i.e. TextBox with TextMode property equal to password) and you want to populate the field with masked password value, assigning value using the Text property will not work.

<asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox>

Instead you have to set the value of the field by adding the ‘value’ attribute to your field.

In C#,

txtPassword.Attributes.Add("value", yourpasswordvalue);

In VB.Net

txtPassword.Attributes.Add("value", yourpasswordvalue)

In Delphi.Net

txtPassword.Attributes.Add('value', yourpasswordvalue);
e liquid Buy Plavix insurance quotes canadian prescription drugs buy Wellbutrin Canada pharmacy online reviews online pharmacies online pharmacy online Canada pharmacy