Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load txtEmployeeid.Focus() If IsPostBack = True Then <pre lang="vb">Dim ext As String = Path.GetExtension(FileUpload1.FileName) Dim newfile As String = txtEmployeeid.Text + ext If FileUpload1.HasFile Then Dim theFileName As String = Path.Combine(Server.MapPath("~/Uploads"), newfile) If File.Exists(theFileName) Then File.Delete(theFileName) End If FileUpload1.SaveAs(theFileName) End If</pre>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)