asp.net 4.0

How to configure session state to use Uri in ASP.NET

Software developer can configure session state through web.config file for his current application (which is found in the same virtual directory as the .aspx web page files). UseUri is the one of possible modes for HttpCookieMode. When this mode is set cookies will be never used, regardless of the capabilities of the browser or device. Instead, the …

Learn more

How to configure session state to use cookies in ASP.NET

Software developer can configure session state through web.config file for his current application (which is found in the same virtual directory as the .aspx web page files).  UseCookies is the one of possible modes for HttpCookieMode. When this mode is set cookies will be always used, even if the browser or device do not support them or they …

Learn more

How to transfer information between pages in ASP.NET using a query string in VB.NET.

Software developer can use this approach for information that don’t need to be hidden or made tamper-prof. Unlike view state information passed through the query string is clearly visible and unencrypted. The query string is the portion of the URL after the question mark in the following example:

https://www.google.com?q=look+for+aspnet+code

Software developer can store information in the query string himself using …

Learn more

How to transfer information between pages in ASP.NET using a query string in C#

Software developer can use this approach for information that don’t need to be hidden or made tamper-prof. Unlike view state information passed through the query string is clearly visible and unencrypted. The query string is the portion of the URL after the question mark in the following example:

https://www.google.com?q=look+for+aspnet+code

Software developer can store information in the query string himself using …

Learn more

How to store custom objects in a View state using VB.NET

Software developer can store custom objects in a view state just as easily as regular types. However, to store an item in a view state, ASP.NET must be able to convert it into a stream of bytes. This process is called serialization. If developer’s objects aren’t serializable, he will receive an error message when he attempts to place …

Learn more

How to store custom objects in a View state using C#

Software developer can store custom objects in a view state just as easily as regular types. However, to store an item in a view state, ASP.NET must be able to convert it into a stream of bytes. This process is called serialization. If developer’s objects aren’t serializable, he will receive an error message when he attempts to place …

Learn more

How to preserve member variables for an ASP.NET page in C#

Software developers can follow the next basic principle. They can save all member variables to View state when the Page.PreRender event occurs and retrieve them when the Page.Load event occurs. The Page.Load event happens every time the page is created. In case of a postback, the Load event occurs first, followed by any other control events. The next …

Learn more

How to encrypt View state for an individual page when it is requested

Software developer can encrypt an individual page only if a control specifically requests it using ViewStateEncryption-Mode property of the Page directive:

<%@Page ViewStateEncryptionMode=”Auto”>

The developer can set the same attribute in a configuration file:

<configuration xmlns =https://scemas.microsoft.com/.NetConfiguration/v2.0>
    <system.web>
        <pages viewStateEncryptionMode=”Auto”>
        …
    </system.web>
</configuration>

Note: Encryption imposes a performance penalty, because the web server will perform the encryption and decryption with each postback.  Don’t encrypt view state …

Learn more