| Swaps's profileSwaps BlogPhotosBlog | Help |
|
Swaps Blog.NET August 11 Make your web application run fasterFolks,
Make your web application run faster
A .NET DLL that may be used to cut response time for your app It is easy to develop your own ASP.NET web application. But making it do some useful things for your users while keeping the design simple and elegant is not so easy. If you are lucky, your web application will be used by more than a handful of users, in that case, performance can become important. For some of the web applications I worked on, performance is vital: the company will lose money if users get frustrated with the slow response.
There are many factors that can result in bad performance, the number of users is just one of them. As a developer in a big corporation, you usually don't have a chance to mess with real production servers. However, I think it is very helpful for developers to take a look at the servers that are hosting their applications. http://www.codeproject.com/aspnet/PEDLL.asp Swapnil (swaps) http://swapsnet.spaces.live.com/
Data Access Tutorials ASP.NET 2.0Folks,
Data Access Tutorials ASP.NET 2.0
Find below link which contains, a series of tutorials that will explore techniques for implementing these common data access patterns in ASP.NET 2.0. These tutorials are geared to be concise and provide step-by-step instructions with plenty of screen shots to walk you through the process visually. Each tutorial is available in Visual Basic and Visual C# versions and includes a download of the complete code used.
Swapnil (swaps)
New Public Properties of the Page ClassNew Public Properties of the Page Class The following public properties are new in ASP.NET 2.0.
AppRelativeTemplateSourceDirectory - Returns the application-relative path to the page or control. For example, for a page located at http://app/folder/page.aspx, the property returns ~/folder/.
AppRelativeVirtualPath - Returns the relative virtual directory path to the page or control. For example for a page located at http://app/folder/page.aspx, the property returns ~/folder/page.aspx.
AsyncTimeout - Gets or sets the timeout used for asynchronous page handling. (Asynchronous pages will be covered later in this module.)
ClientQueryString - A read-only property that returns the query string portion of the requested URL. This value is URL encoded. You can use the UrlDecode method of the HttpServerUtility class to decode it.
ClientScript - This property returns a ClientScriptManager object that can be used to manage ASP.NETs emission of client-side script. (The ClientScriptManager class is covered later in this module.)
EnableEventValidation - This property controls whether or not event validation is enabled for postback and callback events. When enabled, arguments to postback or callback events are verified to ensure that they originated from the server control that originally rendered them.
EnableTheming - This property gets or sets a Boolean that specifies whether or not an ASP.NET 2.0 theme applies to the page.
Form - This property returns the HTML form on the ASPX page as an HtmlForm object.
Header - This property returns a reference to an HtmlHead object that contains the page header. You can use the returned HtmlHead object to get/set style sheets, Meta tags, etc.
IdSeparator - This read-only property gets the character that is used to separate control identifiers when ASP.NET is building a unique ID for controls on a page. It is not intended to be used directly from your code.
IsAsync - This property allows for asynchronous pages. Asynchronous pages are discussed later in this module.
IsCallback - This read-only property returns true if the page is the result of a call back. Call backs are discussed later in this module.
IsCrossPagePostBack - This read-only property returns true if the page is part of a cross-page postback. Cross-page postbacks are covered later in this module.
Items - Returns a reference to an IDictionary instance that contains all objects stored in the pages context. You can add items to this IDictionary object and they will be available to you throughout the lifetime of the context.
MaintainScrollPositionOnPostBack - This property controls whether or not ASP.NET emits JavaScript that maintains the pages scroll position in the browser after a postback occurs. (Details of this property were discussed earlier in this module.)
Master - This read-only property returns a reference to the MasterPage instance for a page to which a master page has been applied.
MasterPageFile - Gets or sets the master page filename for the page. This property can only be set in the PreInit method.
MaxPageStateFieldLength - This property gets or sets the maximum length for the pages state in bytes. If the property is set to a positive number, the pages view state will be broken up into multiple hidden fields so that it doesnt exceed the number of bytes specified. If the property is a negative number, the view state will not be broken into chunks.
PageAdapter - Returns a reference to the PageAdapter object that modifies the page for the requesting browser.
PreviousPage - Returns a reference to the previous page in cases of a Server.Transfer or a cross-page postback.
SkinID - Specifies the ASP.NET 2.0 skin to apply to the page.
StyleSheetTheme - This property gets or sets the style sheet that is applied to a page.
TemplateControl - Returns a reference to the containing control for the page.
Theme - Gets or sets the name of the ASP.NET 2.0 theme applied to the page. This value must be set prior to the PreInit method.
Title - This property gets or sets the title for the page as obtained from the pages header.
ViewStateEncryptionMode - Gets or sets the ViewStateEncryptionMode of the page. See a detailed discussion of this property earlier in this module.
New Protected Properties of the Page Class
The following are the new protected properties of the Page class in ASP.NET 2.0.
Adapter - Returns a reference to the ControlAdapter that renders the page on the device that requested it.
AsyncMode - This property indicates whether or not the page is processed asynchronously. It is intended for use by the runtime and not directly in code.
ClientIDSeparator - This property returns the character used as a separator when creating unique client IDs for controls. It is intended for use by the runtime and not directly in code.
PageStatePersister - This property returns the PageStatePersister object for the page. This property is primarily used by ASP.NET control developers.
UniqueFilePathSuffix - This property returns a unique suffic that is appended to the file path for caching browsers. The default value is __ufps= and a 6-digit number.
New Public Methods for the Page Class
The following public methods are new to the Page class in ASP.NET 2.0.
AddOnPreRenderCompleteAsync - This method registers event handler delegates for asynchronous page execution. Asynchronous pages are discussed later in this module.
ApplyStyleSheetSkin - Applies the properties in a pages style sheet to the page.
ExecuteRegisteredAsyncTasks - This method beings an asynchronous task.
GetValidators - Returns a collection of validators for the specified validation group or the default validation group if none is specified.
RegisterAsyncTask - This method registers a new async task. Asynchronous pages are covered later in this module.
RegisterRequiresControlState - This method tells ASP.NET that the pages control state must be persisted.
RegisterRequiresViewStateEncryption - This method tells ASP.NET that the pages viewstate requires encryption.
ResolveClientUrl - Returns a relative URL that can be used for client requests for images, etc.
SetFocus - This method will set the focus to the control that is specified when the page is initially loaded.
UnregisterRequiresControlState - This method will unregister the control that is passed to it as no longer requiring control state persistence.
Swapnil (swaps)
August 06 New @ Page Directive AttributesNew @ Page Directive Attributes
ASP.NET 2.0 adds many new attributes to the @ Page directive. The following attributes are new in ASP.NET 2.0.
Async - The Async attribute allows you to configure page to be executed asynchronously.
AsyncTimeout - Specified the timeout for asynchronous pages. The default is 45 seconds.
CodeFile - The CodeFile attribute is the replacement for the CodeBehind attribute in Visual Studio 2002/2003.
CodeFileBaseClass - The CodeFileBaseClass attribute is used in cases where you want multiple pages to derive from a single base class. Because of the implementation of partial classes in ASP.NET, without this attribute, a base class that uses shared common fields to reference controls declared in an ASPX page would not work properly because ASP.NETs compilation engine will automatically create new members based on controls in the page. Therefore, if you want a common base class for two or more pages in ASP.NET, you will need to define specify your base class in the CodeFileBaseClass attribute and then derive each pages class from that base class. The CodeFile attribute is also required when this attribute is used.
CompilationMode - This attribute allows you to set the CompilationMode property of the ASPX page. The CompilationMode property is an enumeration containing the values Always, Auto, and Never. The default is Always. The Auto setting will prevent ASP.NET from dynamically compiling the page if possible. Excluding pages from dynamic compilation increases performance. However, if a page that is excluded contains that code that must be compiled, an error will be thrown when the page is browsed.
EnableEventValidation - This attribute specifies whether or not postback and callback events are validated. When this is enabled, arguments to postback or callback events are checked to ensure that they originated from the server control that originally rendered them.
EnableTheming - This attribute specifies whether or not ASP.NET themes are used on a page. The default is false.
LinePragmas - This attribute specifies whether line pragmas should be added during compilation. Line pragmas are options used by debuggers to mark specific sections of code.
MaintainScrollPositionOnPostback - This attribute specifies whether or not JavaScript is injected into the page in order to maintain scroll position between postbacks. This attribute is false by default. When this attribute is true, ASP.NET will add a <script> block on postback that looks like this:
Note that the src for this script block is WebResource.axd. This resource is not a physical path. When this script is requested, ASP.NET dynamically builds the script.
MasterPageFile - This attribute specifies the master page file for the current page. The path can be relative or absolute.
StyleSheetTheme - This attribute allows you to override user-interface appearance properties defined by an ASP.NET 2.0 theme. Specifies the theme for the page. If a value is not specified for the StyleSheetTheme attribute, the Theme attribute overrides all styles applied to controls on the page.
Title - Sets the title for the page. The value specified here will appear in the <title> element of the rendered page.
ViewStateEncryptionMode - Sets the value for the ViewStateEncryptionMode enumeration. The available values are Always, Auto, and Never. The default value is Auto. When this attribute is set to a value of Auto, viewstate is encrypted is a control requests it by calling the RegisterRequiresViewStateEncryption method.
Setting Public Property Values via the @ Page Directive
Another new capability of the @ Page directive in ASP.NET 2.0 is the ability to set the initial value of public properties of a base class. Suppose, for example, that you have a public property called SomeText in your base class and you’d like it to be initialized to Hello when a page is loaded. You can accomplish this by simply setting the value in the @ Page directive like so:
The SomeText attribute of the @ Page directive sets the initial value of the SomeText property in the base class to Hello!.
Swapnil (Swaps) http://swapsnet.spaces.live.com/
Building Silverlight Applications in .NETFolks,
If you are looking to start with Building Silverlight Applications in .NET this is the link from where you can download the PPT which explains the
http://weblogs.asp.net/scottgu/archive/2007/06/19/building-silverlight-applications-using-net.aspx
Hope this might be helpful to you all. Swapnil (Swaps) http://swapsnet.spaces.live.com/
ASP.NET AJAX DocumentationFolks,
Jus back from small vacation.
If you're looking out to start on AJAX and find out some base documentation along with the working samples this is the link to donwload from.
When you download the documentation, be sure that you open the Readme.htm file for setup instructions. The Download includes working samples to help you get most out of ASP.NET AJAX
Swapnil (Swaps)
July 31 VS2008, .NET 3.5, Silverlight and ASP.NET FuturesFolks,
VS2008, .NET 3.5, Silverlight and ASP.NET Futures
Check out the explore the features & Downloads of VS 2008, .NET Framework 3.5, Silverlight.
Swapnil (Swaps)
|
||||
|
|