how to use slider control in ajax?

aswinialuri-19361
Posted by aswinialuri-19361 under ASP.NET AJAX category on | Points: 40 | Views : 1310
code in .aspx page

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="slider.aspx.cs" Inherits="slider" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:scriptmanager ID="Scriptmanager1" runat="server"></asp:scriptmanager>

<asp:SliderExtender
ID="SliderExtender1"
runat="server"
TargetControlID="TextBox1"
BoundControlID="TextBox2"
Minimum="100"
Maximum="700"
Orientation="Vertical"
Steps="7"
Length="250"
>
</asp:SliderExtender>
<table border="0" cellpadding="0" cellspacing="10">
<tr valign="top">
<td>
<asp:TextBox
ID="TextBox1"
runat="server"
>
</asp:TextBox>
<asp:TextBox
ID="TextBox2"
runat="server"
ForeColor="Crimson"
Width="25"
>
</asp:TextBox>
<br />
<asp:LinkButton
ID="LinkButton1"
runat="server"
Text="Apply"
ForeColor="LightPink"
Font-Bold="true"
BorderColor="DeepPink"
BorderWidth="1"
OnClick="LinkButton1_Click"
BackColor="Crimson"
>
</asp:LinkButton>
</td>
<td>
<asp:Image
ID="Image1"
runat="server"
ImageUrl="~/Image/myfbbluepic.jpg"
Width="100"
/>
</td>
</tr>
</table>
<br /><br />
</div>
</form>
</body>
</html>

code in .aspx.cs:
 protected void LinkButton1_Click(object sender, EventArgs e)
{
int imageWidth = Convert.ToInt32(TextBox2.Text);
Image1.Width = 1 * imageWidth;
}

I hope you understand this

Comments or Responses

Login to post response