Click here to Skip to main content
15,887,416 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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 
QuestionThe connection was closed unexpectedly Pin
oujeboland28-Oct-11 2:08
oujeboland28-Oct-11 2:08 
AnswerRe: The connection was closed unexpectedly Pin
Dennis E White28-Oct-11 6:14
professionalDennis E White28-Oct-11 6:14 
GeneralRe: The connection was closed unexpectedly Pin
oujeboland28-Oct-11 7:15
oujeboland28-Oct-11 7:15 
GeneralRe: The connection was closed unexpectedly Pin
Dennis E White28-Oct-11 7:30
professionalDennis E White28-Oct-11 7:30 
GeneralRe: The connection was closed unexpectedly Pin
oujeboland28-Oct-11 21:46
oujeboland28-Oct-11 21:46 
GeneralRe: The connection was closed unexpectedly Pin
Dennis E White29-Oct-11 5:16
professionalDennis E White29-Oct-11 5:16 
GeneralRe: The connection was closed unexpectedly Pin
oujeboland29-Oct-11 20:22
oujeboland29-Oct-11 20:22 
AnswerRe: The connection was closed unexpectedly Pin
jkirkerx28-Oct-11 18:40
professionaljkirkerx28-Oct-11 18:40 
GeneralRe: The connection was closed unexpectedly Pin
oujeboland28-Oct-11 22:12
oujeboland28-Oct-11 22:12 
GeneralRe: The connection was closed unexpectedly Pin
jkirkerx29-Oct-11 7:20
professionaljkirkerx29-Oct-11 7:20 
GeneralRe: The connection was closed unexpectedly Pin
oujeboland29-Oct-11 20:26
oujeboland29-Oct-11 20:26 
QuestionLogin Management Pin
shashiankam27-Oct-11 20:14
shashiankam27-Oct-11 20:14 
AnswerRe: Login Management Pin
Richard MacCutchan27-Oct-11 21:50
mveRichard MacCutchan27-Oct-11 21:50 
GeneralRe: Login Management Pin
shashiankam29-Oct-11 1:19
shashiankam29-Oct-11 1:19 
AnswerRe: Login Management Pin
jkirkerx28-Oct-11 18:48
professionaljkirkerx28-Oct-11 18:48 
Questionvalidate list control 2010 Pin
classy_dog27-Oct-11 12:14
classy_dog27-Oct-11 12:14 

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.