Posts

Showing posts from July, 2013

Count current logged user in asp.net

Image
Count current logged user in asp.net In this article I am writing how to know number of current logged or working user in application. We can achieve this using session value generate at logging time. The base of this process is how much different session value is working on application at current time. Then we count it using Global file logic. Step 1: Design web form  .aspx page < div >     < asp : Label ID ="user_count" runat ="server"></ asp : Label >     </ div >     </ form > Step 2:Logic on .cs Page //for testing  you have to change session value and run it on different browser. //whenever it find a new session value it automatically increase its count by 1. Session[ "name" ] = "sam" ;         user_count.Text = "Count Login User: " + Convert .ToString(Application[ "usercount" ]); Step 3: Add a Global.asax file in your applic...

Sorting in Gridview Using asp.net

Image
Sorting in Gridview Using  asp.net Using soring feature of gridview, we can easily rearrange our data in any order either ascending or descending. Using this we can arrange any type of data like numeric, alphabetic or alphanumeric. Step 1: Design web form .aspx  page     < asp : GridView ID ="gr" runat ="server" AutoGenerateColumns ="false" AlternatingRowStyle-BackColor ="WhiteSmoke" Width ="40%" AllowSorting ="true" OnSorting ="gr_Sorting" >                 < HeaderStyle BackColor ="#3366ff" Font-Bold ="true" ForeColor ="White" />                 < Columns >                                    ...