Posts

View State and Hidden Field

View State and Hidden Field The View State is client state mechanism in the ASP.Net statement management. The view state is control it will be used to maintain the state of the control across the posted back to the server. The view state of a page is, by default, placed in a hidden form field named __VIEWSTATE. Every time it needs to encryption and decryption (serialize and deserialize across the post backs).  The view state can be enabled by setting the property called EnableViewState="true/false".  It can be set in the machine config/ web config/ page directives/ control level. By default it is false. The view state also can store the data using the key and value combination. The data will be serialized and stored in the hidden control you can view the source code page and find the hidden control with _viewstate. Drawbacks : - Increase the page payload (when you have grid with many rows then everything has to be loaded and retain again with seriali

Difference Between For and Foreach loop

For        1.   If you want to access object by Index then use for loop.        2.   To use For loop you must have know that how many times loop repeated. Foreach         1.  if you want to iterate object then use foreach loop .        2.  in for each no need to know about total loop repeating. Performance  wise for loop is faster then foreach.

Implementing Zoom functionality in asp.net

Zoom functionality in asp.net 1. Write the Below code in the  <head> Tag  <script type="text/javascript">         function BrowserZoomPluse() {            nzoom = parseInt(divTest.style.zoom) + 30 + '%';             divTest.style.zoom = nzoom ;         }         function BrowserZoomMinuse() {             nzoom = parseInt(divTest.style.zoom) - 10 + '%';             divTest.style.zoom = nzoom ;         }         function ResetZoom() {             nzoom = parseInt(divTest.value);             divTest.style.zoom = '100%';         }     </script> 2. Add the below Code inside the <body> tag <div id="divTest" style="zoom: 100%">         <div class="textsize">          <a  href="javascript:void(0);" onclick="BrowserZoomPluse();">                 Zoom + </a>                  <a  href="javascript:void(0);" onclick="BrowserZoom

Difference between Layered Architecture and N-Tier Architecture

Layered Architecture vs N-Tier Architecture Layered Architectural Style Layers are the separation of code or you can say organize your come. Layers may be residing in same computer (1 tier) or in separate computer (N- Tier). In the Application each layer communicates with other layer. For example, normally in the application following layer is defined ·                 Presentation Layer (UI) ·          Business Layer ·          Data Access Layer N-Tier Architectural Style  In the N-Tier each layer can be deployed on separate computer. In N-Tier application is logically separated into minimum three layers. Each layer is responsible for specific functionality. Example in Web application security is important so the business layer is deployed behind firewall, and presentation layer is on separate network. Advantages of a layered architecture: Layered architecture provides flexibility, maintainability, and scalability. Layered architecture parallel t