Feb 26th, 2009 | 1 Comment

The GridView control provides you with the option of sorting and paging records without requiring a form-post back to the Web server. In other words, you can re-render the contents of a GridView when sorting and paging, without needing to re-render the entire page.

You enable client paging and sorting by assigning the value true to the EnableSortingAndPagingCallback property. When this property has the value true, the GridView uses JavaScript to request an updated set of records from the Web server.


1 <%@ Page Language=”C#” AutoEventWireup=”true” CodeFile=”Default.aspx.cs” Inherits=”_Default” %>

2

3 <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

4 <html>

5 <head id=”Head1″ runat=”server”>

6 <title>Callback GridView</title>

7 </head>

8 <body>

9 <form id=”Form1″ runat=”server”>

10 <%=DateTime.Now %>

11 <asp:GridView ID=”GridView1″ DataSourceID=”TitlesSource” EnableSortingAndPagingCallbacks=”true”

12 AllowPaging=”true” AllowSorting=”true” runat=”Server” />

13 <asp:SqlDataSource ID=”TitlesSource” ConnectionString=”Server=localhost;Database=northwind;Trusted_Connection=true”

14 SelectCommand=”SELECT * FROM customers” runat=”Server” />

15 </form>

16 </body>

17 </html>


Here when you will sort the page or click on the page number the time will not change as it is being set on the page load but the data will get sorted. The time doesn’t change because the page is not reloaded.

Behind the scenes, the GridView uses the Microsoft Internet Explorer XMLHTTPRequest object to communicate with the Web server. This object is supported by Internet Explorer version 5.0 and higher.

However this does not work when you have a templatefield in your Gridview. If you have a templatefield in your Gridview you need to perform the pagination like traditional way handling the events.

Written by Ajay Matharu

February 26th, 2009 at 7:00 pm

Feb 20th, 2009 | No Comments

Mozilla’s open source Firefox browser has made a significant dent in Internet Explorer’s dominant market share. Much of its popularity is due to the wide availability of third-party add-ons that significantly extend Firefox’s functionality — allowing Firefox to disable Java or JavaScript on the fly, perform JavaScript whitelisting, even host ActiveX controls, for example. Firefox has always pushed the boundary in terms of features and functionality, and it can boast both growing enterprise support and the ability to run on Windows, Mac, and Linux. One claim Firefox can’t make is a high granularity of security control.

Firefox does not automatically ask for elevation when installing, so be sure to run as administrator beforehand if you want it to install the browser into the normal Program Files folder in Windows Vista or another user-securable location. If installed on Vista, Firefox runs as a single process (Firefox.exe) with medium integrity, DEP (Data Execution Prevention) and ASLR (Address Space Layout Randomization) enabled, and file system and registry virtualization disabled. The latter is a feature in Vista that allows users to run applications without having administrative privileges.

Like Google Chrome, Firefox has a JavaScript engine that converts JavaScript source code into native machine code; Firefox uses an open source engine called TraceMonkey. Unlike Chrome, in which the V8 JavaScript engine is always on, Firefox’s JavaScript support can be enabled or disabled across the browser. By using the NoScript add-on, you can enable JavaScript (and Java and Flash) on a per-site basis.

Although add-ons such as NoScript, and plug-ins such as Adobe Flash, bring many useful capabilities to Firefox, at the same time they come with problems and security issues of their own. Firefox has a built-in add-on manager that allows you to browse available extensions, install and uninstall them, and enable and disable them, but again, they can’t be enabled or disabled with per-site granularity.

Security can be defined through the normal Tools > Options menu or by typing “about:config” in the URL bar. The latter option opens up hundreds of behind-the-scenes settings, similar to what might only be found among the registry settings of other browsers. Serious users always configure security using the about:config method, although detailed descriptions on each option can be a little hard to find.

Firefox has a “safe mode” that can be launched to recover from disasters. Even better, whereas Internet Explorer only disables all add-ons by default, Firefox Safe Mode allows you to erase the history files, return browser settings to the defaults, make other necessary changes, and then automatically restart in normal mode. It’s a great little feature.

Firefox passed 9 of the 21 password handling tests on the Password Manager Evaluator. Firefox allows locally stored passwords to be protected by a separate master password, and even tells you how strong your master password is.

Naturally, Firefox’s popularity has brought out the attackers. Many different attacks “in the wild” specifically target Firefox users, making it the second-most-attacked browser behind Internet Explorer. Firefox 3.0 has had at least 39 separate vulnerabilities in less than six months (as compared to 154 vulnerabilities for Firefox 2.0 during its lifetime). Seventy-five percent of these exploits were ranked high-criticality, and a third allowed complete system compromise.

One of the common complaints about Firefox is its lack of support for the enterprise. Although Mozilla doesn’t directly offer tools to ease large installations or to centrally manage Firefox through Group Policy, these are available from independent providers including FirefoxADM and FrontMotion.

All in all, Firefox is a sophisticated open source browser that has earned its place as a market leader. Like Internet Explorer, Firefox enjoys widespread popularity and third-party support. And like Internet Explorer, it continues to struggle with frequently found vulnerabilities, perhaps due in part to the vendor’s commitment to SDL (Security Development Lifecycle) processes, which initially lead to more vulnerabilities being uncovered during testing. Firefox makes a good browser choice for anyone, but especially for users who want to purposefully avoid Internet Explorer (and ActiveX) or who don’t need the finest granularity (e.g., multiple security zones) in their browser’s security.

Written by Ajay Matharu

February 20th, 2009 at 1:08 pm