using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; publicpartialclass Upload : System.Web.UI.UserControl { protectedoverridevoid OnLoad(EventArgs e) { base.OnLoad(e); ScriptManager manager = ScriptManager.GetCurrent(this.Page); if (manager !=null) { manager.RegisterPostBackControl(this.Button1); } } protectedvoid Button1_Click(object sender, EventArgs e) { if (this.FileUpload1.HasFile) { this.TextBox1.Text ="yes"; } else { this.TextBox1.Text ="no"; } } protectedvoid Button2_Click(object sender, EventArgs e) { if (this.FileUpload1.HasFile) { this.TextBox1.Text ="yes"; } else { this.TextBox1.Text ="no"; } } }
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; publicpartialclass Default5 : System.Web.UI.Page { protectedvoid Page_Load(object sender, EventArgs e) { } }