JQueryEasyUI Development Instance

Source: Internet
Author: User
JQueryEasyUI does not need to be introduced. It is a lightweight UI framework, and now there are many resources in this regard, but there are few real instances, especially. net, but Sun Yu has been releasing some EasyUI videos, which may be of great help to everyone. How about me, you can only use one instance to introduce how to use EasyUI.

JQueryEasyUI does not need to be introduced. It is a lightweight UI framework, and now there are many resources in this regard, but there are few real instances, especially. net, but Sun Yu has been releasing some EasyUI videos, which may be of great help to everyone. How about me, we only use one instance to introduce the EasyUI (You are actually a little white, hey ).

With the help of the crazy talent interface framework, everyone feels pretty good.

We all know the drawbacks of. Net Server-side controls. Therefore, we completely discard server-side controls and use all client-side controls.

Below are some preparations.

The following documents and materials will be uploaded later for you to download!

Jquery-easyui-1.2.6 is used here

The jQuery and jQuery EasyUI versions in Xiucai are relatively low, and you can modify them as needed.

Here I will only describe the added parts:

Logon window

ViewCode



User name:



Password:




Initialize JS in the login window

ViewCode
Var formLogin = $ ('# formLogin ');
If (getCookie ('username') = null) // logon to Dialog is displayed if you are not logged on. Otherwise, the rendering is not performed.
FormLogin. dialog ({modal: true,
Closable: false,
Buttons :[{
Text: 'login', handler: function (){
If (! FormLogin. form ("validate ")){
Return;
}
$. Post (
'/Ajax/HandlerLogin. ashx ',
{"Username": $ ("# ipt_username"). val (), "userpwd": $ ("# ipt_userpwd"). val ()},
Function (){
If (a = '0') {// login successful
$. Messager. alert ('hprompt ', 'logon successful', 'info ')
SetCookie ('username', 'wikstone ');
FormLogin. dialog ('close ');
}
Else {// Logon Failed
$. Messager. alert ('hprompt ', 'logon failed', 'info ')
}
}
);
}
}]
}
);

AJAX HandlerLogin Page code

ViewCode
Public void ProcessRequest (HttpContext context)
{
Context. Response. ContentType = "text/plain ";
UserName = context. Request. Form ["username"]. ToString ();
UserPwd = context. Request. Form ["userpwd"]. ToString ();
Context. Response. Write (CheckLogin (userName, userPwd ));
}
Private string CheckLogin (string uname, string upwd)
{
BLL. TUser bll = new BLL. TUser ();
DataTable dt = bll. GetList ("UserName = '" + uname + "' and UserPwd = '" + upwd + "'"). Tables [];
If (dt. Rows. Count>)
{
Return ""; // logon successful
}
Else
Return "";
}

Unlogged on page


After Logon:

Main functions: as a simple example, only user management modules are available: List, add, modify, and delete.

List:

Added:

Modify:

Delete:

Source code download
Http://upload.server110.com/file/20140404/1-140404102S3595.zip

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.