Click here to Skip to main content
15,891,943 members
Articles / Web Development / ASP.NET

Easy Way to Implement Ajax using Jquery in ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.33/5 (3 votes)
28 Aug 2010CPOL3 min read 57.7K   1.1K   35  
Simple steps do an Ajax operation using Jquery and ASP.NET
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace Jquery_Asp.Net.App_Utilities
{
    public class UiUtils
    {
    }

    /// <summary>
    /// Jquery Serializated Item
    /// Author :Sreekumar
    ///CreatedDate :8/6/2010
    /// </summary>
    /// <returns>JQSeriazileItem</returns>
    public class JQDeSeriazileItem
    {
        public string Name
        {
            get;
            set;
        }
        public string Value
        {
            get;
            set;
        }
    }
    public class JQDeSeriazileProcess
    {
        JQDeSeriazileItem _item = new JQDeSeriazileItem();
        public string StringParm
        {
            get;
            set;
        }
        private string[] _strKeyValue;

        public JQDeSeriazileProcess(string stringParm)
        {
            this.StringParm = stringParm;
            _strKeyValue = StringParm.Split('&');
        }
        public JQDeSeriazileItem this[string Name]
        {
            get
            {
                if (StringParm == string.Empty)
                    return null;

                JQDeSeriazileItem item = new JQDeSeriazileItem();
                item.Name = Name;

                string[] _str;

                var strSelector = Array.Find(_strKeyValue, str => str.ToLower().StartsWith(Name.ToLower()));
                if (strSelector == null)
                {
                    item.Value = "";
                }
                else
                {
                    _str = strSelector.Split('=');

                    item.Value = (_str[1] != null) ? _str[1] : "";
                }
                return item;
            }
        }
    }
    public class JQDeSeriazile
    {
        JQDeSeriazileProcess _item;
        public JQDeSeriazile(string parms)
        {
            _item = new JQDeSeriazileProcess(HttpContext.Current.Server.UrlDecode(parms));
        }
        public JQDeSeriazileItem this[string Name]
        {
            get
            {
                return _item[Name];
            }
        }

    }



}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions