Hi,
I want to use a RadDatePicker clientside that I add dynamically to my page using a PageMethods.
I was wondering if it is possible to achieve this. I don't want to do any postback with it, so I don't care about the server code, I only want to use it client side.
I want to do something like this:
VB
JS
And then be able to use the value and client side events.
Thanks!
I want to use a RadDatePicker clientside that I add dynamically to my page using a PageMethods.
I was wondering if it is possible to achieve this. I don't want to do any postback with it, so I don't care about the server code, I only want to use it client side.
I want to do something like this:
<
telerik:RadButton
runat
=
"server"
ID
=
"btnTest"
Text
=
"test"
AutoPostBack
=
"false"
OnClientClicked
=
"click"
>
</
telerik:RadButton
>
<
div
id
=
"divTest"
></
div
>
VB
<System.Web.Services.WebMethod()> _
Public
Shared
Function
AddDatePicker()
As
String
Dim
sw
As
New
StringWriter()
Dim
writer
As
New
HtmlTextWriter(sw)
Dim
rdp
As
New
RadDatePicker()
rdp.RenderControl(writer)
Return
sw.ToString()
End
Function
JS
<script type=
"text/javascript"
>
function
click(sender, args) {
PageMethods.Test(
function
(response) {
$(
"#divTest"
).html(response);
},
function
(error) {
alert(error);
});
}
</script>
And then be able to use the value and client side events.
Thanks!