Click here to Skip to main content
Click here to Skip to main content
Articles » Database » Database » General » Downloads
 
Add your own
alternative version

Tagged as

Display/Store and Retrieve Image Data from Database to Gridview, and also on Mouse Over

, 15 Oct 2011 CPOL
How to Display/Store and Retrieve Image Data from Database to Gridview, and also on mouse over
UserSample.zip
UserSample
~$gemArticle.docx
AlgemArticle.docx
Sample
App_Code
App_Data
Bin
AjaxControlToolkit.dll
AjaxControlToolkit.dll.refresh
Utils.dll
Utils.dll.refresh
Utils.pdb
css
Images
accordionHeaderIcon.png
BlackLoadingBar.gif
btn_delete.gif
btn_edit.gif
Calendar.png
close.gif
Copy of gridheader.gif
del.png
downarrow.gif
excel_icon.gif
gridfooter.gif
gridfooter.JPG
gridheader.gif
headermenu.jpg
headerpanel.jpg
lock.png
loginbg.jpg
LoginPanelBG.png
minniloader.gif
pdf.jpg
print-button.gif
scan.gif
spicture.gif
spicture.jpg
Thumbs.db
txt.png
view.gif
js
arrowdown.gif
arrowup.gif
Members.JPG
Sample (3).suo
Show
Algem_G_Mojedo.jpg
Asds_A_Asdasd.jpg
Firstname_M_Lastname.jpg
Sdfdfsdf_S_Sdfsdf.jpg
Test_T_Test.jpg
Test1_T_Resr1.jpg
Thumbs.db
Zxdzx_Z_Zxzx.jpg
upload
UsersControl
Utils
Utils
bin
Debug
Utils.dll
Utils.pdb
obj
Debug
Refactor
TempPE
Utils.dll
Utils.pdb
Properties
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UserAccountUC.ascx.cs"
    Inherits="UsersControl_UserAccountUC" %>
<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>

<script type="text/javascript" language="javascript">
   <!--
    function RetrievePicture(imgCtrl, picid) {
        imgCtrl.onload = null;
        imgCtrl.src = 'ShowImage.ashx?id=' + picid;
    }
    -->
</script>

<table width="100%">
    <table frame="box" width="100%">
        <tr>
            <td width="2%">
            </td>
            <td>
                <h1>
                    <asp:Label ID="lblAccountPanel" runat="server" Font-Size="Medium" ForeColor="Black"
                        Text="User Settings"></asp:Label>
                </h1>
            </td>
            <td align="right">
                <asp:ImageButton ID="btnClose" runat="server" CausesValidation="false" ImageUrl="~/Images/close.gif"
                    OnClick="btnClose_Click" />
            </td>
            <td width="2%">
            </td>
        </tr>
    </table>
    <table frame="box" width="100%">
        <tr>
            <td width="2%">
            </td>
            <td class="style1">
                <asp:FileUpload ID="FileUpload1" runat="server" />
            </td>
            <td width="2%">
            </td>
        </tr>
    </table>
    <table frame="box" width="100%">
        <tr>
            <td width="2%">
            </td>
            <td>
                <div class="pictureWrap" style="float: left; width: 100px; height: 100px; border: 1px solid #ccc;">
                    <asp:UpdatePanel ID="upImg" runat="server" UpdateMode="Conditional">
                        <ContentTemplate>
                            <asp:Image ID="Image1" runat="server" Height="100px" ImageAlign="Middle" Visible="true"
                                Width="100px" OnError="src='images/spicture.jpg'" />
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <asp:Button ID="btnUpLoad" runat="server" Text="Upload Img." OnClick="btnUpload_Click" />
                </div>
                <br />
                <table>
                    <tr>
                        <td align="right">
                            <label>
                                User Name:
                            </label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtUserName" runat="server" Title="Enter Username" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                Password:
                            </label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtPassword" runat="server" MaxLength="20" TextMode="Password" Title="p@ssw0rd"  />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                Confirm Password:
                            </label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtPasswordConf" runat="server" MaxLength="20" TextMode="Password" Title="p@ssw0rd" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                First Name:
                            </label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtFirstName" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                Middle Name:
                            </label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtMiddleName" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                Last Name:
                            </label>
                        </td>
                        <td>
                            <asp:TextBox ID="txtLastName" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            <label>
                                Access Level:
                            </label>
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlAccessLevel" runat="server" Width="155">
                                <asp:ListItem Text="Processor" Value="1"> </asp:ListItem>
                                <asp:ListItem Text="Approver" Value="2"> </asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td align="left">
                            &nbsp;
                        </td>
                        <td>
                            <asp:CheckBox ID="chkActive" runat="server" Text="Is Active" TextAlign="Left" Checked="true" />
                        </td>
                    </tr>
                </table>
            </td>
            <td width="2%">
            </td>
        </tr>
    </table>
    <table frame="box" width="100%">
        <tr>
            <td width="2%">
            </td>
            <td>
                <asp:Label ID="Label1" runat="server" ForeColor="Red" Text=""></asp:Label>
            </td>
            <td width="2%">
            </td>
        </tr>
    </table>
    <table frame="box" width="100%">
        <tr align="center">
            <td width="2%">
            </td>
            <td>
                <asp:Button ID="btnSave" runat="server" CssClass="button-primary" OnClick="btnSave_Click"
                    TabIndex="100" Text="Save" />
                <asp:Button ID="btnClear" runat="server" CssClass="button-primary" OnClick="btnClear_Click"
                    TabIndex="100" Text="Clear" />
            </td>
            <td width="2%">
            </td>
        </tr>
    </table>
</table>
<br />
<asp:HiddenField ID="hidUserID" runat="server" />
<asp:HiddenField ID="hfFileToUpload" runat="server" />
<asp:HiddenField ID="hfUrl" runat="server" />

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Al Moje
Software Developer (Senior) ***
Philippines Philippines
MCTS - Microsoft Certified Technology Specialist.
An Accountant.
Had been developed Payroll Accounting System Application
Live in: Quezon City, Metro Manila Philippines
Could reached at email address: ag_mojedo@live.com

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141216.1 | Last Updated 15 Oct 2011
Article Copyright 2011 by Al Moje
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid