Click here to Skip to main content
16,009,391 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questiontable control asp.net 2010 Pin
classy_dog1-Nov-11 9:27
classy_dog1-Nov-11 9:27 
AnswerRe: table control asp.net 2010 Pin
Dennis E White1-Nov-11 12:01
professionalDennis E White1-Nov-11 12:01 
QuestionAsync Report MVC3 Pin
eddieangel1-Nov-11 7:00
eddieangel1-Nov-11 7:00 
QuestionNeeded Code of changing dropdownlist Pin
Raghu1630-Oct-11 19:28
Raghu1630-Oct-11 19:28 
AnswerRe: Needed Code of changing dropdownlist Pin
Anurag Gandhi30-Oct-11 22:47
professionalAnurag Gandhi30-Oct-11 22:47 
QuestionCan't see my site's flash in an iframe tag Pin
benams30-Oct-11 6:37
benams30-Oct-11 6:37 
QuestionSubmitChanges is not working Pin
classy_dog29-Oct-11 8:17
classy_dog29-Oct-11 8:17 
AnswerRe: SubmitChanges is not working Pin
Richard MacCutchan29-Oct-11 22:38
mveRichard MacCutchan29-Oct-11 22:38 
GeneralRe: SubmitChanges is not working Pin
classy_dog30-Oct-11 11:06
classy_dog30-Oct-11 11:06 
GeneralRe: SubmitChanges is not working Pin
Richard MacCutchan30-Oct-11 23:36
mveRichard MacCutchan30-Oct-11 23:36 
AnswerRe: SubmitChanges is not working Pin
phil.o29-Oct-11 23:54
professionalphil.o29-Oct-11 23:54 
GeneralRe: SubmitChanges is not working Pin
classy_dog30-Oct-11 11:08
classy_dog30-Oct-11 11:08 
GeneralRe: SubmitChanges is not working Pin
phil.o30-Oct-11 23:18
professionalphil.o30-Oct-11 23:18 
AnswerRe: SubmitChanges is not working Pin
oujeboland30-Oct-11 7:03
oujeboland30-Oct-11 7:03 
GeneralRe: SubmitChanges is not working Pin
classy_dog30-Oct-11 11:09
classy_dog30-Oct-11 11:09 
Questionvalidation control final? Pin
classy_dog29-Oct-11 8:05
classy_dog29-Oct-11 8:05 
AnswerRe: validation control final? Pin
Brij1-Nov-11 1:34
mentorBrij1-Nov-11 1:34 
QuestionHow to implement an automatic task in asp.net Pin
TRAORE cheickna29-Oct-11 2:40
TRAORE cheickna29-Oct-11 2:40 
AnswerRe: How to implement an automatic task in asp.net Pin
Philippe Mori29-Oct-11 3:15
Philippe Mori29-Oct-11 3:15 
GeneralRe: How to implement an automatic task in asp.net Pin
TRAORE cheickna29-Oct-11 3:41
TRAORE cheickna29-Oct-11 3:41 
GeneralRe: How to implement an automatic task in asp.net Pin
Philippe Mori29-Oct-11 4:23
Philippe Mori29-Oct-11 4:23 
AnswerRe: How to implement an automatic task in asp.net Pin
Not Active29-Oct-11 4:23
mentorNot Active29-Oct-11 4:23 
Questionwebform error Pin
sc steinhayse28-Oct-11 11:42
sc steinhayse28-Oct-11 11:42 
Questioncustom validator Pin
Member 821751728-Oct-11 5:14
Member 821751728-Oct-11 5:14 
I have setup a custom validator on a checkbox list 2010 C# asp.net control. The custom control does 'work', but I still have a question about it. When an item is not selected from the checkboxlist control, the OnServerValidate code is executed once the 'submit' button is clicked.

Is there a way to display the error message once the foucs has moved from the checkboxlist control to the next item on the web page? If so, can you explain how this would occur and point me to a reference that would explain this process?

I have one additional question that is once the OnServerValidate event is fired, the error message does not display. The display occurs once I have code in the 'submiton event' that says if (!Page.IsPostBack) return; I would think once the OnServerValidate event finishes executing, I error message should be displayed. The error message should not wait until the logic in the submit button fires. Thus can you tell me if this is ok and why? if this is not ok, can you tell me why not and possibly point me to a reference to solve this issue?

The following is the code I am referring to:

[^] <asp:CustomValidator ID="CustomValidatorContractNumber" runat="server" CssClass="errorStyle"
OnServerValidate="ValidateNumber" ValidateEmptyText="True"
EnableClientScript="False"
ErrorMessage="You must select at least one item.">
</asp:CustomValidator>


public void ValidateNumber(Object source, ServerValidateEventArgs args)
{
args.IsValid = false;

for (int i = 0; i < ChkBoxLstPlan.Items.Count; i++)
{

if (ChkBoxLstPlan.Items[i].Selected)
{

args.IsValid = true;

}

}

}


protected void submitbutton(object sender, EventArgs e)
{


if (!Page.IsPostBack)
return;
} [^]
AnswerRe: custom validator Pin
Brij1-Nov-11 1:45
mentorBrij1-Nov-11 1:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.