// build SEO friendly Meta tag Title, Keywords, Descriptions in ASP.? NET Websiteprotectedvoid
Page_Load(object sender, EventArgs e) {if (!Page.IsPostBack) {Page.Title = “SEO Expert India,SEO Services India,SEO Company India,SEO Professional India,India SEO Firms,SEO Experts in UK,SEO Experts in USA”;
HtmlMeta metaTag = newHtmlMeta();
metaTag.Name = “keywords”;metaTag.Content = “search engine optimization,website marketing, search engine optimization company, search engine ranking, search engine optimization services, seo services, search engine positioning services, seo, seo company, search engine placement company, web site promotion”;base.Master.Page.Header.Controls.Add(metaTag);
Difference between properties and get/set method in .net
Properties
Properties represent data.
Properties can easily ? for using the XML serializer
Properties should behave as if they are fields
Retrieving a field’s value does not produce any side effects.
Method
Methods perform actions
Method can’t easily ? use the XML Serialise using get / set methis
The method performs a time-consuming operation. The method is perceivably slower than the time it takes to set or get a field’s value.
The method performs a conversion. Accessing a field does not return a converted version of the data it stores.
The “Get” method has an observable side effect
Calling the method twice in succession creates different results.
The method is static but returns an object that can be changed by the caller. Retrieving a field’s value does not allow the caller to change the data stored by the field.
This article introduces a methodology, Ajax, you can use to build more dynamic and responsive Web applications. The key lies in the combination of browser-side JavaScript, DHTML, and asynchronous communication with the server. This article also demonstrates just how easy it is to start using this approach, by leveraging an Ajax framework (DWR) to construct an application that communicates with backend services directly from the browser. If used properly, this tremendous power allows your application to be more natural and responsive to your users, thereby providing an improved browsing experience.
The sample code used in this application is available for download as a standalone WAR file.
Introduction
The term Ajax is used to describe a set of technologies that allow browsers to provide users with a more natural browsing experience. Before Ajax, Web sites forced their users into the submit/wait/redisplay paradigm, where the users’ actions were always synchronized with the server’s “think time.” Ajax provides the ability to communicate with the server asynchronously, thereby freeing the user experience from the request/response cycle. With Ajax, when a user clicks a button, you can use JavaScript and DHTML to immediately update the UI, and spawn an asynchronous request to the server to perform an update or query a database. When the request returns, you can then use JavaScript and CSS to update your UI accordingly without refreshing the entire page. Most importantly, users don’t even know your code is communicating with the server: the Web site feels like it’s instantly responding.
While the infrastructure needed by Ajax has been available for a while, it is only recently that the true power of asynchronous requests has been leveraged. The ability to have an extremely responsive Web site is exciting as it finally allows developers and designers to create “desktop-like” usability with the standard HTML/CSS/JavaScript stack.
Traditionally in J2EE, developers have been so focused on developing the service and persistence layers that the usability of the user interface has lagged behind. It is common to hear phases such as, “we don’t have time to invest in the UI” or “you can’t do that with HTML” during a typical J2EE development cycle. The following Web sites prove that these excuses don’t hold water any longer:
All these Web sites show that Web applications don’t need to rely solely on pages being reloaded from the server to present changes to the user. Everything seems to happen almost instantly. In short, when it comes to designing a responsive user interface, the bar has now been set much higher.
Defining Ajax
Jesse James Garrett at Adaptive Path defined Ajax as follows:
Ajax isn’t a technology. It’s really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates:
Standards-based presentation using XHTML and CSS
Dynamic display and interaction using the Document Object Model
Asynchronous server communication using XMLHttpRequest
JavaScript binding everything together
This is all fine and dandy, but why the name Ajax? Well, the term Ajax was coined by Jesse James Garrett, and as he puts it, it is “short-hand for Asynchronous JavaScript + XML.”
How Does Ajax Work?
The kernel of Ajax is the XmlHttpRequest JavaScript object. This JavaScript object was originally introduced in Internet Explorer 5, and it is the enabling technology that allows asynchronous requests. In short, XmlHttpRequest lets you use JavaScript to make a request to the server and process the response without blocking the user.
By performing screen updates on the client, you have a great amount of flexibility when it comes to creating your Web site. Here are some ideas for what you can accomplish with Ajax:
Dynamically update the totals on your shopping cart without forcing the user to click Update and wait for the server to resend the entire page.
Increase site performance by reducing the amount of data downloaded from the server. For example, on Amazon’s shopping cart page, when I update the quantity of an item in my basket, the entire page is reloaded, which forces 32K of data to be downloaded. If you use Ajax to calculate the new total, the server can respond with just the new total value, thereby reducing the required bandwidth 100 fold.
Eliminate page refreshes every time there is user input. For example, if the user clicks Next on a paginated list, Ajax allows you to just refresh the list with the server data, instead of redrawing the entire page.
Edit table data directly in place, without requiring the user to navigate to a new page to edit the data. With Ajax, when the user clicks Edit, you can redraw the static table into a table with editable contents. Once the user clicks Done, you can spawn an Ajax request to update the server, and redraw the table to have static, display-only data.
1) During the compilation of .NET application 1.x, Visual Studio 2003 would automatically compile only certain file types such as ASP.NET pages, Web services, user controls, HTTP handlers, Resource files and Global.asax class files. The rest of the file need to explicitly compile before finally publishing your code to the web server.
2) For modify an application, you need to open the entire project, make changes and need to recompile again to publish the code to the web server.
3) The code-behind model requires IIS Virtual Directory. The code-behind model can directly access the local installation of IIS.
4) It requires IIS on development computer.
5) Unable to open individual pages outside the project.
6) It requires explicit addition of files to the project.
7) The compilation models of ASP.NET 1.x and ASP.NET 2.0 built on completely different bases. In the ASP.NET runtime the life cycle of a page is marked by a series of events. In ASP.NET 1.x, based on user interaction a page request is sent to the Web server. The event that is initiated by the page request is Init. After the Init event, Load event is raised. Following the Load event, PreRender event is raised. Finally, the Unload event is raised and an output page is returned to the client.
Asp.Net 2.0
1) In Visual Studio 2005, you no longer need to compile all the files into an assembly. The ASP.NET dynamic compile engine allows to automatically compile the applications, that includes .aspx, .cs, .vb files. That means, simply create application and publish it. A shared class consists of reusable source components in the Code folder. The new Code-Separation model extends the Compile-on-Demand feature to the classes bound to a Web page, but it does not stop there; helper classes can also take advantage of it. You can keep your helper classes and business objects in the App_Code folder. ASP.NET monitors the folder and compiles any new class file that is added or edited. The resulting assembly is automatically referenced in the application and shared between all pages participating in the site. You should put only components into the App_Code folder. Do not put pages, Web user controls, or other non-code files containing non-code elements into the App_Code subdirectory. All the files in the App_Code folder are dynamically compiled to a single assembly, named code.dll. The assembly has application scope and is created in the Temporary ASP.NET Files folder, well outside the Web application space.
2) You just need to open the individual file which you want to make the changes and publish the code to the web server without having to recompile.
3) The code-behind model lacks support for FTP, local file system, and direct IIS access. The code-behind model has multiple ways to open Web sites.
4) It has already built-in Web server.
5) Need not open the entire project; you can open individual pages outside the project, it is achieved through Compile-on-demand feature.
6) It eliminates the need to explicitly add files to the project.
7) The new class-derivation model enables the page to define controls without the need to have protected members created in the inherited separation file, or to have explicit event definition. Pages that use code separation take advantage of a feature known as Partial Classes. When the page runs, ASP.NET 2.0 dynamically creates and instantiates a class representing the page and the compiler uses the CodeFile attribute in the @Page directive to find the file containing the code. The Inherits attributes defines the name of the class that will be created and this should be default, the page name as the basis for creating the class name
The @Page directive in ASP.NET 2.0 has several new attributes. These attributes allow developers to control new framework features such as personalization and theming. The Page class in ASP.NET 2.0 also has new properties, methods, and events.
Properties
The properties of the Page object fall into two distinct groups: intrinsic objects and page-specific properties. Intrinsic objects include references to environmental standalone objects such as Cache, User, and Trace. They also include references to the classic intrinsic objects that form the HTTP context, such as Session, Application, and Request. Page-specific properties are all the properties that affect or describe the state of the page, for example, IsPostBack, EnableViewState, and SmartNavigation.
The new properties of the Page class can also be categorized into either of the preceding groups.
The three important new properties are:
1. ClientScript. Instance of the ClientScriptManager class that represents a separate object, and which groups all the methods working with the client-side scripts.
2. Header.IPageHeader interface that represents the contents of the page’s block if this is marked as runat=server. 3. Master. Gets the master page that determines the overall look of the page.
Methods
The Page class features several new methods, most of which are simply inherited from the base Control class.
Some of the important methods are:
• GetValidators. Returns the collection of all validator controls that belong to the specified group.
• SetFocus. Sets the input focus to a particular control contained in the page.
• RegisterRequiresControlState. Registers the specified control as one that requires control state management. ASP.NET 2.0 adds quite a few new events to allow you to follow the request processing more closely and precisely. These new events are discussed in the following table.
Events Description
PreInit This occurs before the page begins initialization. This is the first event in the life of an ASP.NET 2.0 page.
InitComplete This occurs when the page initialization is completed.
PreLoad This occurs immediately after initialization and before the page begins loading the state information.
LoadComplete This occurs at the end of the load stage of the page’s life cycle.
PreRenderComplete This occurs when the prerendering phase is complete and all child controls have been created. After this event, the personalization data and the view state are saved and the page renders to HTML.