Private: MY Note

Every thing you imagine, study it – know it – use it

Call webservice from javascript

October 11, 2009 Posted by dev1 | AJAX, ASP.NET, ASP.NET 3.0, ASP.NET 3.5, JAVASCRIPT | | No Comments Yet

Sorting Generic List

//Sorting List<> case Item is ListItem
//==============================================
List<ListItem> tempList = new List<ListItem>();

tempList.Insert(0, new ListItem("------------- Vehicle Reports 8"));
tempList.Insert(0, new ListItem("------------- Vehicle Reports 2"));
tempList.Insert(0, new ListItem("------------- Vehicle Reports 4"));

// sort asc
tempList.Sort(delegate(ListItem p1, ListItem p2) {
                    return p1.Text.CompareTo(p2.Text);
                });
// sort desc
tempList.Sort(delegate(ListItem p1, ListItem p2) {
                    return p2.Text.CompareTo(p1.Text);
                });

//Sorting List<> case Item is Object Class
//===============================================
//Apply to sorting in GridView
//===============================================
SortData(e.SortExpression, NewSortDirection, ref listMsgTicker);
//===============================================

#region method for sorting

    private void SortData(string _expression, SortDirection _direction,
            ref List<MsgTicker> data)
    {
        //sort asc ==
        if (_direction == SortDirection.Ascending)
            data.Sort(delegate(MsgTicker a, MsgTicker b)
            {
                switch (_expression)
                {
                    case "MsgHeader": return a.MsgHeader.CompareTo(b.MsgHeader);
                    case "CreatedDate": return a.CreatedDate.CompareTo(b.CreatedDate);
                    case "ModifiedDate": return a.ModifiedDate.CompareTo(b.ModifiedDate);
                    default:
                        throw new NotImplementedException("Type of property not implemented yet");
                }
            });

        //sort desc ==
        if (_direction == SortDirection.Descending)
            data.Sort(delegate(MsgTicker a, MsgTicker b)
            {
                switch (_expression)
                {
                    case "MsgHeader": return b.MsgHeader.CompareTo(a.MsgHeader);
                    case "CreatedDate": return b.CreatedDate.CompareTo(a.CreatedDate);
                    case "ModifiedDate": return b.ModifiedDate.CompareTo(a.ModifiedDate);
                    default:
                        throw new NotImplementedException("Type of property not implemented yet");
                }
            });

        //return data;
    }

    #endregion
ref: http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/06/20/How-to-sort-a-generic-List_3C00_T_3E00_.aspx

September 16, 2009 Posted by dev1 | .NET, .NET 2.0, AJAX, ASP.NET, ASP.NET 3.0, ASP.NET 3.5 | | No Comments Yet

How to… move from AjaxPro to ASP.NET AJAX PageMethods

October 7, 2008 Posted by dev1 | AJAX, ASP.NET 3.0 | | No Comments Yet

AJAX For Beginners

What is AJAX? AJAX stands for Asynchronous JavaScript and XML. AJAX uses a combination of Javascript and XML to allow web pages to be updated with new data from the server. It consists of HTML, JavaScript, DHTML, and DOM. The traditional way of processing data between client’s browser and a server was to submit a HTML form and send data to the server, the server processed the data and sent a response back to the browser.

The disadvantage of this method is that the web page must be reloaded in the browser. As a new and outstanding approach, AJAX allows to write web-applications without reloading the page on user interaction. By using AJAX, we can create better, faster and easier to use web applications.

 

AJAX Introduction
AJAX Basic
AJAX Display Contents
AJAX Get and Post
AJAX and Database
AJAX and XML
AJAX Dynamically Update Data

September 28, 2008 Posted by dev1 | AJAX | | No Comments Yet

javascript css ajax

September 21, 2008 Posted by dev1 | AJAX | | No Comments Yet

ajax javascript tip

September 21, 2008 Posted by dev1 | AJAX, JSON | | No Comments Yet

table sort javascript

http://www.mattkruse.com/javascript/sorttable/#

Description: 
A common need is to have a table of results or data in the browser and to let the user sort the columns in the browser without needing to go back to the server each time.

This complex script allows that functionality using extensive DHTML.

In older browsers (<4) no sorting will happen, and in Netscape the tables may not contain form elements if you wish them to be sorted. 

Example: 


(Click on the plain text column headers to sort)

Submitted
Sel Order Num S Ref Date Serial    
43870  
1 
43870  
14Jun2000
 
43810  
1 
43810  
14Jun2000
 
43727  
1 
43727  
14Jun2000
 
43949  
1 
43949  
14Jun2000
 
43598  
02Jun2000
 
43894  
1 
43894  
14Jun2000
 
43794  
1 
43794  
12Jun2000
 
43928  
1 
43928  
14Jun2000
 
43640  
1 
43640  
14Jun2000
 

Name ID Bonus
Mary Doe
111
$765.43
John Doe
12345
$500.00
James Baker
555
$0.99

September 20, 2008 Posted by dev1 | AJAX | | No Comments Yet

tab

February 26, 2008 Posted by dev1 | AJAX | | 1 Comment

Random number

randomnumber = Math.round(14 * Math.random());
document.write (randomnumber);

January 25, 2008 Posted by dev1 | AJAX | | No Comments Yet

Asynchronous Callbacks and Ajax based UI Experience in Web Applications

Web applications work on the underlying Http protocol and Http is stateless by nature. It uses the Request - Response pattern between the client and the server, to process the logic at the server and present the information in HTML to the client browser. In the case of long running applications, it would be helpful to the end user to see some status on the browser when the application is processing some complex logic on the server. This article shows a convenient way of showing status information in such cases. The sample demos show how to achieve this in .NET 2.0 using the CallBack infrastructure provided in the framework and also a means to achieve the same effect using the .NET 1.1 framework.

ref: http://www.c-sharpcorner.com/UploadFile/deepakvraghavan/AjaxProgressBars09082006171908PM/AjaxProgressBars.aspx

December 1, 2007 Posted by dev1 | .NET 2.0, AJAX | | No Comments Yet