Hi Friends.,
How to Create a Validation For Text Box Which is Empty in Repeater, it Needs to Throw Value Required Error Message How to Create it
With Regards....,
R.V.Rajagopalan
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Jul 20, 2014, 9:27 PM EDT
hi,
Please refer below link it might help you.
http://www.chrislord.me/blog/aspnet-validation-control-inside-a-repeater-or-listview/
http://www.aspnetajaxtutorials.com/2010/09/customvalidator-registerexpandoattribut.html
hope this will help you.
Rajagopalan R VRank #6,801 · 256 reputationPosted Jul 30, 2014, 8:44 PM EDT
Thanq For Your Reply Can i Get Even More Clear For This Query , With Clear Solution
With Regards....,
R.V.Rajagopalan
Rajagopalan R VRank #6,801 · 256 reputationPosted Aug 6, 2014, 3:50 AM EDT
This Validates My Repeater ThanQ All Members And Especially
Jignesh Trivedi
protected bool ValidateRepeaterEmptyCheck()
{
bool result = true;
int count = 0;
TextBox tbx1 = new TextBox();
TextBox tbx2 = new TextBox();
foreach (RepeaterItem dataItem in rptrDetails.Items)
{
tbx1 = (TextBox)dataItem.FindControl("tbx1");
tbx2 = (TextBox)dataItem.FindControl("tbx2");
if (!string.IsNullOrWhiteSpace(tbx1.Text) || !string.IsNullOrWhiteSpace(tbx2.Text))
{
if (string.IsNullOrWhiteSpace(tbx1.Text))
{
count++;
tbx1.BackColor = System.Drawing.Color.DarkOrange;
}
if (string.IsNullOrWhiteSpace(tbx2.Text))
{
count++;
tbx2.BackColor = System.Drawing.Color.DarkOrange;
}
if (count == 0)
{
tbx1.BackColor = System.Drawing.Color.White;
tbx2.BackColor = System.Drawing.Color.White;
}
}
else
{
tbx1.BackColor = System.Drawing.Color.White;
tbx2.BackColor = System.Drawing.Color.White;
}
}
if (count > 0)
{
Master.ShowMessage("Fill Repeater Details", MessageHelper.MessageType.Warning);
result = false;
}
return result;
}
With Regards....,
R.V.Rajagopalan