This is a migrated thread and some comments may be shown as answers.

How to reset telerik:RadTimePicker to NULL or empty after clicking a button on a .ascx user control?

1 Answer 25 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 23 Jul 2013, 03:08 PM
How to reset telerik:RadTimePicker to NULL or empty after clicking a button on a .ascx user control?

Things that I tried, but not working:

  • Time.Clear(); in code
  • JavaScript - (It works on .aspx, but not .ascx)
 <script type="text/javascript">
     function clearTime(sender, args) {
        $find("<%= Time.ClientID %>").clear();
    }
</script>
<asp:Button ID="btnSave" runat="server" Text="Save" OnClientClick="clearTime"  />
I get this error message:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).


Thanks

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 25 Jul 2013, 12:46 PM
Hello,

Please add JS code inside RadCodeBlock.

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
            function clearTime(sender, args) {
           $find("<%= Time.ClientID %>").clear();
          }
</script>
        
    </telerik:RadCodeBlock>


Thanks,
Jayesh Goyani
Tags
General Discussions
Asked by
Kevin
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or