It seems that if you have your form submit button inside a RadAjaxPanel and you exit the sub where you are handling the button click, it will not focus or show labels outside of the RadAjaxPanel
Here is the code on the page:
Here is the code behind where I am validating that at least one of seven checkboxes is selected in a checkbox list named chklPayment :
Now if the label is INSIDE the RadAjaxPanel - say right below the submit button, it will toggle label visibility as the code requires BUT if the label is contained OUTSIDE the RadAjaxPanel, it will not toggle at all. I've spent about three hours on this with varying testing scenarios and this behavior is definitely happening. I have the submit button inside the RadAjaxPanel because I am using a Loading Panel with it as the form takes awhile sometimes to complete the postback.
No biggie as I can put the label inside the RadAjaxPanel and it works fine. I can also use the label to say something like "Please wait while your information is updated" or something like that if validation passes for the checkbox list. Sorry if this is already noted somewhere in the documentation - I couldn't find it.
Here is the code on the page:
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanelx"
LoadingPanelID
=
"RadAjaxLoadingPanelx"
runat
=
"server"
>
<
asp:Button
ID
=
"btnSubmit"
runat
=
"server"
CausesValidation
=
"true"
OnClick
=
"btnSubmit_Click"
Text
=
"Submit"
/><
br
/>
</
telerik:RadAjaxPanel
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanelx"
Height
=
"300"
Width
=
"500"
runat
=
"server"
Skin
=
"Sunset"
>
</
telerik:RadAjaxLoadingPanel
>
Here is the code behind where I am validating that at least one of seven checkboxes is selected in a checkbox list named chklPayment :
Public
Sub
btnSubmit_Click(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
' Check to see at least one checkbox checked.
Dim
CheckedBox
As
Boolean
=
False
For
Each
CheckedItem
As
ListItem
In
chklPayment.Items
If
CheckedItem.Selected =
True
Then
CheckedBox =
True
End
If
Next
If
CheckedBox =
False
Then
lblError.Visible =
True
chklPayment.Focus()
Exit
Sub
Else
lblError.Visible =
False
End
If
End
Sub
Now if the label is INSIDE the RadAjaxPanel - say right below the submit button, it will toggle label visibility as the code requires BUT if the label is contained OUTSIDE the RadAjaxPanel, it will not toggle at all. I've spent about three hours on this with varying testing scenarios and this behavior is definitely happening. I have the submit button inside the RadAjaxPanel because I am using a Loading Panel with it as the form takes awhile sometimes to complete the postback.
No biggie as I can put the label inside the RadAjaxPanel and it works fine. I can also use the label to say something like "Please wait while your information is updated" or something like that if validation passes for the checkbox list. Sorry if this is already noted somewhere in the documentation - I couldn't find it.