-
Notifications
You must be signed in to change notification settings - Fork 2
/
StudChangePhoto.aspx
37 lines (35 loc) · 2.06 KB
/
StudChangePhoto.aspx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<%@ Page Title="" Language="C#" MasterPageFile="~/StudMasterPage.master" AutoEventWireup="true" CodeFile="StudChangePhoto.aspx.cs" Inherits="StudChangePhoto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:Label ID="Label1" runat="server" Font-Names="Pristina" Font-Size="X-Large"
ForeColor="Blue" Text="Change Photo"></asp:Label>
<hr size="3px" style="color: #0088CC" />
Select Photo<asp:FileUpload ID="fuPhoto" runat="server" Width="302px" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="fuPhoto" ErrorMessage="RequiredFieldValidator"
ForeColor="Red">*</asp:RequiredFieldValidator>
<asp:Button ID="btnUpload" runat="server" onclick="btnUpload_Click"
Text="Upload" />
<hr size="3px" style="color: #0088CC" />
<asp:SqlDataSource ID="sqlchangePhoto" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [UserMaster] WHERE [UserID] = @UserID"
InsertCommand="INSERT INTO [UserMaster] ([UserID], [PhotoURL]) VALUES (@UserID, @PhotoURL)"
SelectCommand="SELECT [UserID], [PhotoURL] FROM [UserMaster]"
UpdateCommand="UPDATE [UserMaster] SET [PhotoURL] = @PhotoURL WHERE [UserID] = @UserID">
<DeleteParameters>
<asp:Parameter Name="UserID" Type="String" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="UserID" Type="String" />
<asp:Parameter Name="PhotoURL" Type="String" />
</InsertParameters>
<UpdateParameters>
<asp:ControlParameter ControlID="hfPhoto" Name="PhotoURL" PropertyName="Value"
Type="String" />
<asp:SessionParameter Name="UserID" SessionField="userid" Type="String" />
</UpdateParameters>
</asp:SqlDataSource>
<asp:HiddenField ID="hfPhoto" runat="server" />
</asp:Content>