File Upload
<asp:FileUpload ID="FileUpload1" runat="server" />
<asp:Button ID="Button2" runat="server"Text="Button" onclick="Button2_Click" />
<asp:Label ID="Label1" runat="server" ></asp:Label>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class patientreportform : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
}
protected void Button2_Click(object sender, EventArgs e)
{
FileUpload1.SaveAs(Server.MapPath("~") + "//files//" + FileUpload1.FileName);
Label1.Text = FileUpload1.FileName;
}
}
<asp:Button ID="Button2" runat="server"Text="Button" onclick="Button2_Click" />
<asp:Label ID="Label1" runat="server" ></asp:Label>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class patientreportform : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
}
}
protected void Button2_Click(object sender, EventArgs e)
{
FileUpload1.SaveAs(Server.MapPath("~") + "//files//" + FileUpload1.FileName);
Label1.Text = FileUpload1.FileName;
}
}