Click here to Skip to main content
15,889,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Source page code as follows

ASP.NET
<div>
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table border="0" width="600px" cellpadding="2" cellspacing="1" style="border: 1px solid maroon;">
<tr bgcolor="maroon">
<th>
course</th>
<th>
Courseamt</th>
<th>
Coursedate</th>

</tr>
</HeaderTemplate>
<itemtemplate>
<tr>

<td width="100">
<%# DataBinder.Eval(Container, "DataItem.course")%>
</td>
<td>
<%# DataBinder.Eval(Container, "DataItem.Courseamt")%>
</td>
<td width="150">
<%# DataBinder.Eval(Container, "DataItem.Coursedate")%>
</td>

</tr>
</itemtemplate>
<alternatingitemtemplate>
<tr bgcolor="#e8e8e8">
<td width="100">
<%# DataBinder.Eval(Container, "DataItem.course")%>
</td>
<td>
<%# DataBinder.Eval(Container, "DataItem.Courseamt")%>
</td>
<td width="150">
<%# DataBinder.Eval(Container, "DataItem.Coursedate")%>
</td>>
</tr>
</alternatingitemtemplate>
<footertemplate>
</footertemplate></table>


       
    <asp:Button ID="Submit" runat="server" />
    
<div style="font-size:14px; color:Navy">
     </div>
</div>

My code as follows
C#
protected void Page_Load(object sender, EventArgs e)
{
    SqlConnection con = new SqlConnection("Server=(local);initial catalog=Himt_Testing;Trusted_Connection=True");
    string str;
    SqlCommand cmd = new SqlCommand("select *  from Tb_Course_details", con);
    cmd.Connection.Open();
    Repeater1.DataSource = cmd.ExecuteReader();
    Repeater1.DataBind();
    cmd.Connection.Close();
}

when i run the above code shows output as follows in repeater control

Coursename   Amount   Coursedate

RPST       400       29 Apr 14
RPSCRB     500       30 Apr 14

Then i have one button called Submit.

When i click submit button,i have to show the message the RPST and RPSCRB course must be same date.

for that how can i validate using repeater control.


[Edit member="Tadit"]
Added pre tags.
[/Edit]
Posted
v2

1 solution

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900