In this step you'll customize the C1Slider control. The following steps assume you've completed the Step 1 of 3: Adding C1Slider to the Page topic and added the C1Slider control to the page.
Complete the following steps:
Copy Code
|
|
---|---|
<cc1:C1Slider ID="C1Slider1" runat="server" onclientbuttonclick="C1Slider1_OnClientButtonClick" Value="50" /> |
Example Title |
Copy Code
|
---|---|
<input id="Text1" type="text" onchange="Text1_OnChange()"/> |
Copy Code
|
|
---|---|
<script type="text/javascript" language="javascript"> function C1Slider1_OnClientButtonClick(sender, eventargs) { document.getElementById("Text1").value = $("#<%=C1Slider1.ClientID%>").c1slider("value"); }; function Text1_OnChange() { var val = parseInt(document.getElementById("Text1").value); $("#<%=C1Slider1.ClientID%>").c1slider("value", val); }; </script> |
Now the text box's value will change when the C1Slider's value changes and the slider's value will now change when the text box's value changes.
In this step you've customized the controls with JavaScript. In the next (and last) step you'll run your application and see the C1Slider control in action.