Posts

Showing posts from February, 2017

ASP.net - Gridview - Add, Edit and delete

Gridview - Add, Edit and delete In this article we create a Gridview from database and add some additional operations such a add, edit and delete data in the GridView control. In the previous article , we learned how to create a simple GridView at runtime . GridView at Runtime Database In this article I have used Microsoft's Pubs database for sample data. You can download it free from the following link. Download Here we connect the Stores table of Pubs database for these operations. You can see the structure of the table here. After setting the database, create a new Asp.Net project and open the design view and write the following code in the aspx file. Default.aspx <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server">     <title>Gridview Add, Edit and Delete</ti...

ASP.net - Datalist component Populate

DataList.aspx <%------DATALIST---START----%> <div> <asp:DataList ID="FamilyDataList1" runat="server" RepeatColumns="1" onitemcommand="DataList1_ItemCommand"> <ItemTemplate><asp:Panel ID="Panel1" runat="server" BorderColor="#FF9933" BorderWidth="1px" Height="200px" Width="400px"> <table height="150" > <%--<tr > <td width="75%" style="color: #FF0000; font-weight: bold" align="center"> <asp:ImageButton ID="Image1" runat="server" CssClass="img-circle" ImageUrl='<%# Eval("CONTACT_PHOTO") %>' CommandName="ViewDetails" CommandArgument='<%# Eval("CONTACT_ID") %>'> </asp:ImageButton> </td> </tr>--%> <tr > <td width="75%" style="color: #0000FF; font-weight: bold">...