TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
narasiman rao
NA
519
771.7k
How to validate the repeater control in asp.net using c#
Apr 24 2014 8:11 AM
My 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>
</table>
</FooterTemplate>
</asp:Repeater>
<asp:Button ID="Submit" runat="server" OnClick="Submit_Click" />
<div style="font-size:14px; color:Navy">
</div>
</div>
Apsx 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();
}
Output as follows
Coursename Amount Coursedate
RPST 500 29 Apr 2014
RPSCRB 600 30 APr 2014
i have one button called submit. when i click the submit button i wan to validate the RPST and RPSCRB date must be the same date.
for that how can i validate in asp.net using c#.
Regards,
Narasiman P.
Reply
Answers (
1
)
how to create drawing in windows phone 7 app??
Windows Phone 8 ListBox With CheckBox