Use jQuery UI through standard ASP. NET controls

Source: Internet
Author: User

JQuery UI provides powerful front-end functions, including calendar and drag-and-drop features based on scripts and style sheets. However, these functions are all based on javascript programming, for programmers who are not attribute-specific, it is still difficult to master jQuery UI.

Today, I want to introduce you to a standard ASP. NET control library JuiceUI, which you can download from this address http://www.juiceui.com.

JuiceUI is an open-source WebForms control set. You can simply use jQuery UI components in the WebForm project. Now, you can easily use the popular JavaScript interface library in ASP. NET projects.

For example, if you want to implement a pop-up calendar selector in the page, the following code can be done.

 
 
  1. <asp:TextBox runat="server" ID="_Default" />  
  2. <Juice:Datepicker runat="server" TargetControlID="_Default" /> 

Drag a widget!

Note: The use of ScriptManager must be added first.

 
 
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="JuiceUI_1.WebForm1" %> 
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  4.     <title></title> 
  5. <body> 
  6.     <form id="form1" runat="server"> 
  7.     <div> 
  8.         <asp:ScriptManager ID="ScriptManager1" runat="server"> 
  9.  </asp:ScriptManager> 
  10.         <asp:TextBox runat="server" ID="_Default" /> 
  11.         <juice:Datepicker runat="server" TargetControlID="_Default" /> 
  12.     </div> 
  13.     </form> 
  14. </body> 

The following controls are even provided:

  • Page up/down-last month/next month
  • Ctrl + page up/down-previous year/next year
  • Ctrl + home-current month or open when closed
  • Ctrl + left/right-yesterday/tomorrow
  • Ctrl + up/down-last week/time week
  • Enter-accept the selected date
  • Ctrl + end-close and erase the date
  • Escape-close the datepicker without selection

You can drag it from the toolbox.

What? You want more control in the code, no problem! You can set a large number of attributes, such as DateFormat.

Download it here! Http://nuget.org/packages/JuiceUI

If you have installed NuGet, you can directly use this command to add this support for your project.

Install-Package JuiceUI

Note: This library is based on jQuery and jQuery UI. The following is the version it uses:

JQuery 1.7.1

JQuery. UI. Combined1.8.17

After installation, all required files are already in your project, including jQuery.

Including scripts

Include all files in your project folder.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.