Click here to Skip to main content
12,396,961 members (39,367 online)
See more: C#
Repeater control as follows

CourseName Amount Coursedate
RPST 200 29 APR 2014
RFPFF 400 29 APR 2014

Then i have one button called submit.
When i click that button i want to show message RPST and RFPFF Date must not be same date and RPST date is next date of RFPFF date.

for the above two validation. how can i do in using c#.

My code as follows in submit button,

string strdt = string.Empty;
foreach(RepeaterItem ri in rptCart1.Items)
    CheckBox cbox = (CheckBox)ri.FindControl("chk");
    if (cbox.Checked = true)
        HiddenField lbl = (HiddenField)ri.FindControl("hdDate");
        strdt = strdt + lbl.Value + ",";
 string[] strRdate = strdt.Split(',');
 if (strRdate.Length > 2)
     if (strRdate[0] == strRdate[1])
      Label23.Text = "Dates are matched";
        Label23.Text = "Dates are not matched";

When i run user has to select the date as follows (Output as follows)

CourseName Amount Coursedate
RPST 200 29 APR 2014
RFPFF 400 30 APR 2014

The RPST and RFPFF date must not same date and RPST is the next date of RFPFF date.
for that what changes i have to be made using my above code.

Narasiman P
Closed because this exact post has already been posted by another member. Reported by Nelek, ProgramFOX, Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ) on Sunday, August 24, 2014 2:41am
Posted 25-Apr-14 0:45am
Closed 24-Aug-14 2:41am

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 25 Apr 2014
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100