Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. g System.Collections.Generic;
  2. using System.Linq;
  3. using System.Web;
  4. using System.Web.UI;
  5. using System.Web.UI.WebControls;
  6. public partial class Uploadfile : System.Web.UI.Page
  7. {
  8. protected void Page_Load(object sender, EventArgs e)
  9. {
  10. }
  11. protected void btnUpload_Click(object sender, EventArgs e)
  12. {
  13. fuSample.SaveAs(Server.MapPath("Files") + "//" + fuSample.FileName);
  14. lblMessage.Text = "File Successfully Uploaded";
  15. }
  16.  
  17. protected void Button1_Click(object sender, EventArgs e)
  18. {
  19.  
  20. }
  21. }
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Uploadfile" %>
  29. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  30. <html xmlns="http://www.w3.org/1999/xhtml">
  31. <head runat="server">
  32. <title>File Upload Control</title>
  33. </head>
  34. <body>
  35. <form id="form1" runat="server">
  36. <div>
  37. <asp:FileUpload runat="server" ID="fuSample" />
  38. <asp:Button runat="server" ID="btnUpload" Text="Upload"
  39. onclick="btnUpload_Click" />
  40. <asp:Label runat="server" ID="lblMessage" Text=""></asp:Label>
  41. </div>
  42. <p>
  43. <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
  44. </p>
  45. </form>
  46. </body>
  47. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement