.net2.0 ajax1.0 滑动条示例


引用AjaxControlToolkit.dll
dll下载: /Files/prolifes/AjaxControlToolkit.rar

1.前台aspx
<% @ Page Language = " C# "  AutoEventWireup = " true "  CodeFile = " Default.aspx.cs "  Inherits = " _Default "   %>
<% @ Register
    Assembly
= " AjaxControlToolkit "
    Namespace
= " AjaxControlToolkit "
    TagPrefix
= " ajaxToolkit "   %>
<! 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 " >
    
< asp:ScriptManager id = " ScriptManager1 "  runat = " server "  EnablePartialRendering = " true "   />
    
< div  >
       
< table >
         
< tr >
            
< td style = " width:140px; height: 26px; " >
                
< asp:TextBox ID = " Slider1 "  runat = " server "  AutoPostBack = " true "  style = " right:0px "  Text = " 0 "   />
            
</ td >
            
< td style = " width:15px; height: 26px; " ></ td >
            
< td style = " width:auto; height: 26px; " >
                
< asp:Label ID = " Slider1_BoundControl "  runat = " server "  style = " text-align:right "   />
            
</ td >
         
</ tr >
      
</ table >
        
< ajaxToolkit:SliderExtender ID = " SliderExtender1 "  runat = " server "
            BehaviorID
= " Slider1 "
            TargetControlID
= " Slider1 "
            Minimum
= " 1 "
            Maximum
= " 100 "
            BoundControlID
= " Slider1_BoundControl "
            Steps
= " 100 "   />
    
</ div >
    
</ form >
</ body >
</ html >
 
2.后台cs
using  System;
using  System.Data;
using  System.Configuration;
using  System.Collections;
using  System.Web;
using  System.Web.Security;
using  System.Web.UI;
using  System.Web.UI.WebControls;
using  System.Web.UI.WebControls.WebParts;
using  System.Web.UI.HtmlControls;

public   partial   class  _Default : System.Web.UI.Page
{
    
protected void Page_Load(object sender, EventArgs e)
    
{
        ScriptManager1.RegisterAsyncPostBackControl(Slider1);
    }

}



3.web.config
<? xml version = " 1.0 " ?>
< configuration >
    
< system.web >
    
< pages >
      
< controls >
        
< add tagPrefix = " asp "   namespace = " System.Web.UI "  assembly = " System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 " />
      
</ controls >
    
</ pages >
    
    
< httpHandlers >
      
< remove verb = " * "  path = " *.asmx " />
      
< add verb = " * "  path = " *.asmx "  validate = " false "  type = " System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 " />
      
< add verb = " * "  path = " *_AppService.axd "  validate = " false "  type = " System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 " />
      
< add verb = " GET,HEAD "  path = " ScriptResource.axd "  type = " System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 "  validate = " false " />
    
</ httpHandlers >

    
</ system.web >
</ configuration >



4.代码下载: /Files/prolifes/SampleWebSite.rar

你可能感兴趣的:(Ajax,职场,休闲)