RadInputManager on a Custom User Control
Greetings,
<%@ Control Language="C#"%>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sitefinity" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" %>
<
telerik:RadFormDecorator
ID
=
"FormDecorator1"
runat
=
"server"
DecoratedControls
=
"Textbox"
></
telerik:RadFormDecorator
>
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel1"
runat
=
"server"
>
<
div
class
=
"login_field"
><
asp:TextBox
ID
=
"TextBoxUsername"
runat
=
"server"
Width
=
"100%"
ValidationGroup
=
"Login"
/></
div
>
<
div
class
=
"login_field"
><
asp:TextBox
ID
=
"TextBoxPassword"
runat
=
"server"
TextMode
=
"Password"
Width
=
"100%"
ValidationGroup
=
"Login"
/></
div
>
<
div
class
=
"login_button"
><
asp:ImageButton
ID
=
"ButtonDoLogin"
runat
=
"server"
CausesValidation
=
"true"
ValidationGroup
=
"Login"
/></
div
>
<
div
style
=
"clear: both"
></
div
>
<
div
class
=
"login_keepmeloggedin"
><
asp:CheckBox
ID
=
"CheckBoxKeepMeLoggedIn"
runat
=
"server"
Text
=
"Keep Me Logged-In"
/></
div
>
<
div
class
=
"login_forgotpassword"
><
a
href
=
"teste.aspx"
>Forgot my password</
a
></
div
>
<
div
style
=
"clear: both"
></
div
>
<
div
class
=
"login_error"
><
asp:Label
ID
=
"LoginErrorMessage"
Text
=
"Incorrect credentials, please try again."
runat
=
"server"
Visible
=
"false"
></
asp:Label
></
div
>
<
telerik:RadInputManager
ID
=
"RadInputManager1"
runat
=
"server"
>
<
telerik:TextBoxSetting
BehaviorID
=
"TextBoxUsernameBehavior"
>
<
Validation
IsRequired
=
"true"
ValidateOnEvent
=
"Blur"
ValidationGroup
=
"Login"
/>
<
TargetControls
>
<
telerik:TargetInput
ControlID
=
"TextBoxUsername"
/>
</
TargetControls
>
</
telerik:TextBoxSetting
>
<
telerik:TextBoxSetting
BehaviorID
=
"TextBoxPasswordBehavior"
>
<
Validation
IsRequired
=
"true"
ValidateOnEvent
=
"Blur"
ValidationGroup
=
"Login"
/>
<
TargetControls
>
<
telerik:TargetInput
ControlID
=
"TextBoxPassword"
/>
</
TargetControls
>
</
telerik:TextBoxSetting
>
</
telerik:RadInputManager
>
</
telerik:RadAjaxPanel
>
namespace Controls.Login
[RequireScriptManager]
[ControlDesigner(typeof(LoginDesigner))]
public class Login : SimpleView
protected override void InitializeControls(GenericContainer controlContainer)
ButtonDoLogin.Click += ButtonDoLogin_Click;
void ButtonDoLogin_Click(object sender, ImageClickEventArgs e)
protected override string LayoutTemplateName
get return "Controls.Login.Views.Login.ascx";
protected virtual ImageButton ButtonDoLogin
get return base.Container.GetControl<
ImageButton
>("ButtonDoLogin", true);
protected virtual CheckBox CheckBoxKeepMeLoggedIn
get return base.Container.GetControl<
CheckBox
>("CheckBoxKeepMeLoggedIn", true);
protected virtual Label LoginErrorMessage
get return base.Container.GetControl<
Label
>("LoginErrorMessage", true);
protected virtual TextBox TextBoxUsername
get return base.Container.GetControl<
TextBox
>("TextBoxUsername", true);
protected virtual TextBox TextBoxPassword
get return base.Container.GetControl<
TextBox
>("TextBoxPassword", true);
Hi Daniel,
This is a bug that we have logged for fixing. We are sorry for the inconvenience caused.
All the best,
Ivan Dimitrov
the Telerik team
Has this been resolved? - for me it still seems to be an issue in 4.2
Hello,
We are still working on a fix for this bug. Please excuse us for the inconvenience caused.
All the best,
Jen Peleva
the Telerik team
Time frame?
I have similar issue while using RadInputManger on a composite control and this composite control is used in custom user control. This custom user control is loaded in RadMultiPage where this causes javascript issue in ajax function below. Issue occurs in line in bold below.
_updatePanel: function PageRequestManager$_updatePanel(updatePanelElement, rendering)
Hello guys,
The implementation of this feature is not that trivial and we will need additional time to come up with the best solution. However, you can take a look at this forum thread, where a workaround to the problem is offered. Also, another workaround would be to use the ASP.NEW validation controls. Take a look at the sample for further reference:
.ascx
<%@ Control Language="C#"%>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI"%>
<
br
/>
<
asp:TextBox
ID
=
"TextBox1"
runat
=
"server"
></
asp:TextBox
>
<
br
/>
<
asp:TextBox
ID
=
"TextBox2"
runat
=
"server"
></
asp:TextBox
>
<
br
/>
<
telerik:RadButton
Text
=
"ClickME!"
ID
=
"SubmitButton"
runat
=
"server"
/>
<
br
/>
<
asp:RegularExpressionValidator
ID
=
"MyNumericValidator"
runat
=
"server"
ControlToValidate
=
"TextBox2"
ErrorMessage
=
"Please enter a valid number(0-9)"
ValidationExpression
=
"[0-9]"
/>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator1"
runat
=
"server"
ControlToValidate
=
"TextBox1"
ErrorMessage
=
"Please enter some text"
> *
</
asp:RequiredFieldValidator
>
<
asp:ValidationSummary
ID
=
"ValidationSummary1"
runat
=
"server"
HeaderText
=
"There were errors on the page:"
/>
public
class
Class1 : SimpleView
protected
void
Page_Load(
object
sender, EventArgs e)
submitButton.Text = Page.IsValid.ToString();
public
RadButton submitButton
get
return
base
.Container.GetControl<RadButton>(
"SubmitButton"
,
true
);
protected
override
void
InitializeControls(GenericContainer container)
submitButton.Click +=
new
EventHandler(submitButton_Click);
void
submitButton_Click(
object
sender, EventArgs e)
submitButton.Text = Page.IsValid.ToString();
protected
override
string
LayoutTemplateName
get
return
"SitefinityControls.Resources.TestInput.ascx"
;
public
override
string
LayoutTemplatePath
get
return
this
._LayoutTemplatePath;
set
base
.LayoutTemplatePath = value;
string
_LayoutTemplatePath =
"~/SfSamples/SitefinityControls.Resources.TestInput.ascx"
;