In this Application i am using repeater control
what is repeater control ?
- The Repeater control is used to display a repeated list of items that are bound to the control. The Repeater control may be bound to a database table, an XML file, or another list of items. Here we will show how to bind an XML file to a Repeater control .
I'm using visual studio 2013 , Create a ASP.NET WEB APPLICATION .
1. Go to File > New > Project .
2. Click on web and Choose Asp.net Empty web application .
2. Click on web and Choose Asp.net Empty web application .
3. Go to solution explorer and right click on your application .
4. Click on Add > New Item .
4. Click on Add > New Item .
5. Choose Web Forms .
.aspx Page Code :
<form id="form1" runat="server">
<div class="txt" style="height: 50px; margin-top: 0px;
background-color: #293955;"align="center">
<h1 class="txt" style="width: 337px; height: 50px">
<asp:Label ID="Label1" runat="server" Font-Names="Comic Sans MS"
Font-Size="20pt" ForeColor="Maroon" Text="Share Your Views"
BackColor="White"></asp:Label>
</h1>
</div>
<div style="height: 413px">
<table class="style1">
<tr>
<td class="style2"> </td>
<td class="style3"> </td>
<td> </td>
</tr>
<tr>
<td class="style2"> </td>
<td class="style3"> </td>
<td> </td>
</tr>
<tr>
<td align="center" class="style2">
<asp:Label ID="Label2" runat="server" Font-Names="Comic Sans MS"
Font-Size="14pt" ForeColor="Maroon" Text="Name :"></asp:Label>
</td>
<td class="style3">
<asp:TextBox ID="TextBox1" runat="server" Height="25px" Width="220px">
</asp:TextBox>
<br />
<asp:RequiredFieldValidator ID="rfv1" runat="server"
ControlToValidate="TextBox1" ValidationGroup="grp1"
ForeColor="#CC0000">* Enter Your Name</asp:RequiredFieldValidator>
</td>
<td> </td>
</tr>
<tr>
<td align="center" class="style2">
<asp:Label ID="Label3" runat="server" Font-Names="Comic Sans MS"
Font-Size="14pt" ForeColor="Maroon" Text="Share Your Problem :">
</asp:Label>
<br />
</td>
<td class="style3">
<asp:TextBox ID="TextBox2" runat="server" Height="98px"
TextMode="MultiLine" Width="268px"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfv21" runat="server"
ControlToValidate="TextBox2" ValidationGroup="grp1"
ForeColor="#CC0000">* You Miss it</asp:RequiredFieldValidator>
</td>
<td> </td>
</tr>
<tr>
<td class="style2"> </td>
<td align="right" class="style3">
<asp:Button ID="Button1" runat="server" Font-Bold="False"
Font-Names="Comic Sans MS" Text="Submit" ValidationGroup="grp1"
onclick="Button1_Click" />
</td>
<td> </td>
</tr>
<tr>
<td class="style2"> </td>
<td class="style3"> </td>
<td> </td>
</tr>
</table>
</div>
<div>
<asp:Repeater ID="rep1" runat="server">
<HeaderTemplate>
<table cellpadding="0">
<tr>
<td>
<b>Post a Feedback , comment , Question</b>
</td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<table>
<tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<td>
<asp:Label ID="Label4" runat="server" Text='<%#Eval("name")%>'
ForeColor="Maroon" />:
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>
<table>
<tr>
<td>
<asp:Label ID="Label5" runat="server" Text='<%#Eval("people_views")%>'>
</asp:Label>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
----------------------------------------------------------------------------------------------------------------
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
<p style="height: 1px; margin-bottom: 4px"></p>
<div style="background-color: #000000; height: 1px;"> </div>
<div style="height: 37px">
<a href="FirstPage.aspx" style="color: #800000; text-decoration: none;"
<asp:HyperLink ID="HyperLink17" runat="server" CssClass="hyprlnk"
Font-Size="14pt" ForeColor="Maroon" Font-Names="Comic Sans MS">
Back to Home</asp:HyperLink></a>
</div>
</form>
Design Page :
Coding Part :
- Take two Label .
- Take two Textbox .
- Take one Button ( Button name is submit ) .
Feed your data in a database so, first you can create one database .
I'm using Microsoft Sql Server , I'm creating one database and inside the database i'm creating one table also,in this table you can feed your data .
- I'm creating my own database.
How to create your own Database in SQL ?
- sharma is my database name , you can create your database in sql using this statement create database database_name.
How to use your database in sql , how to create your table inside your database ?
- This Statement help you for using your database in SQL , use database_name.
2. Now, i'm creating one table.
- emp is your table name and empName , comment is your column name .
- create table table_name ( column_name Data_type , column_name Data_type ), This statement helps you to create your table in SQL .
How to show your table ?
- This statement to show your table , select * from table_name .
SQL Code :
create database sharma use sharma create table emp(empName varchar(25) , comment varchar(MAX)) select * from emp
Repeater Control Code :
<asp:Repeater ID="rep1" runat="server">
<HeaderTemplate>
<table cellpadding="0">
<tr>
<td>
<b>Post a Feedback , comment , Question</b>
</td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<table>
<tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<td>
<asp:Label ID="Label4" runat="server" Text='<%#Eval("name")%>'
ForeColor="Maroon" /> :</td>
</tr>
</table>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>
<table>
<tr>
<td>
<asp:Label ID="Label5" runat="server" Text='<%#Eval("people_views")%>'>
</asp:Label>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2">
------------------------------------------------------------------------------------------------------------
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>



