Source page code as follows
<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
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]