Posts

Showing posts with the label ASP.Net

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 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

Display multiple marker point on Google Map with same location or same Longitude,Latitude

 Display multiple marker point on Google Map with same location or same Longitude, Latitude <!DOCTYPE html> <html> <head>     <title>Google Map</title> <!-- For Google Map Style Sheet--> <style type="text/css">     #map_canvas     {         height: 450px;         width: 980px;     }     .infowindow     {         font-size: 12px;         width: 200px !important;         font-family: verdana;     }     @media print     {         #map_canvas         {             height: 950px;         }     } </style> <!-- For Google Map--> <script src="http://maps.google.com/maps/api/js?v=3.7&amp;sensor=false" type="text/javascript"></script> <!--downlaod the oms.min.js javascript file from https://github.com/jawj/OverlappingMarkerSpiderfier --> <script src="JS/oms.min.js" type="text/javascript"></script> <script type="text/java

Check Session Timeot for Whole Application

1. Create a BasePage.cs in App_Code  and write the following code         protected void Page_Init(object sender, EventArgs e)         {             if (Context.Session != null)             {                 if (Session.IsNewSession)                 {                     HttpCookie newSessionIdCookie = Request.Cookies["ASP.NET_SessionId"];                     if (newSessionIdCookie != null)                     {                         string newSessionIdCookieValue = newSessionIdCookie.Value;                         if (newSessionIdCookieValue != string.Empty)                         {                             //This means Session was timed Out and New Session was started                             Response.Redirect("Home.aspx");                         }                     }                 }             }         } 2. Inherit this basepage on all the aspx pages such as using System; using System.Collections.Generic; using System.Col