Back to Home Execution Stages: For web: HTTP request for Application Incoming request routed to Controller (Perform Routing) The controller processes request and create presentation Model The controller also selects appropriate result (view) Model is passed to View View transforms Model into an appropriate output format (HTML) The response is rendered (HTTP response) Image Courtesy: SlideShare.net Back to Home
Life cycle when the page processed during a postback The events associated with the relevant page cycle phases are: Page Initialization: Page_Init View State Loading:LoadViewState Postback data processing: LoadPostData Page Loading: Page_Load PostBack Change Notification: RaisePostDataChangedEvent PostBack Event Handling: RaisePostBackEvent Page Pre Rendering Phase: Page_PreRender View State Saving: SaveViewState Page Rendering: Page_Render Page Unloading: Page_UnLoad The processing sequence in which a page is processed during a postback event is: Initializing: During this phase, the server creates an instance of the server control Loading view state: During this phase, the view state of the control posted by the client is reloaded into the new instance of the control. Loading : During this phase, the instance of the control is loaded onto the page object in which it is defined. Loading the postback data : During this phase, the server s...
Method 1: Response.AddHeader To Refresh Web page After every 5 Seconds You can add following code, Response.AddHeader("Refresh", "5"); Cricket Sites, Stock Exchange sites use similar logic :) Method 2: In body Tag, window.setTimeout The 1000 = 1 Second... < body onload ="window.setTimeout('window.location.reload()',1000);" > Method 3: In Meta Tag Theres also a meta tag that you can define on the head, but not sure wheter it refreshes even if the content has not finished loading or if it starts counting when the head section loaded. Code would be something like that: < meta content ="600" http-equiv ="refresh" > Method 4: Timer Control : Microsoft ASP.NET 2.0 AJAX Extensions server control In following example, the timer interval is set to 10 seconds <%@ Page Language="C#" AutoEventWireup="true" %> <! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN...
We frequently have requirement like Passing IDs in comma saperated value to the sql server for further processing. Generally what we do is just create loop and get the value from it and ... But SQL 2005 comes up with XQuery. Using this you can easly pass such type of data also some complex thing too. For example... DECLARE @productIds xml SET @productIds ='<Products><id>9</id><id>18</id><id>27</id></Products>' SELECT ParamValues.ID.value ('.','VARCHAR(20)')FROM @productIds.nodes('/Products/id')as ParamValues(ID) Which gives us the following three rows: 9 18 27
(Works in both SQL Server 7.0 and 2000) Declare @OrderList varchar (500) set @OrderList = 'Order1,Order2,,Order3,,,Order4,Order5,' ; drop TABLE #TempList CREATE TABLE #TempList ( OrderID varchar (20) ) DECLARE @OrderID varchar (10), @Pos int SET @OrderList = LTRIM(RTRIM(@OrderList))+ ',' SET @Pos = CHARINDEX( ',' , @OrderList, 1) IF REPLACE(@OrderList, ',' , '' ) <> '' BEGIN WHILE @Pos > 0 BEGIN SET @OrderID = LTRIM(RTRIM( LEFT (@OrderList, @Pos - 1))) IF @OrderID <> '' BEGIN INSERT INTO #TempList (OrderID) VALUES (@OrderID) END SET @OrderList = RIGHT (@OrderList, LEN(@OrderList) - @Pos) SET @Pos = CHARINDEX( ',' , @OrderList, 1) END END SELECT * FROM #TempList t +-+-+-+-+-+ OUTPUT +-+-+-+-+-+ OrderID -------- -- Order1 Order2 Order3 Order4 Order5
Polymorphism means having more than one form. Overloading and overriding are used to implement polymorphism. Polymorphism Examples Method Overloading Method Overriding There are two type of Polymorphism 1. Compile time polymorphism (Early binding or static binding) Examples: overloaded methods, overloaded operators and overridden methods that are called directly by using derived objects. 2. Run time polymorphism (Late binding or dynamic binding) Example: overridden methods that are called using base class object.
Overview of the ASP.NET MVC - Introduction to ASP.NET MVC - ASP.NET MVC Version History - Life Cycle of MVC request - Role of Model, View, and Controller - Works Behaviour of ASP.NET MVC - Benefits MVC Architecture - Razor View Engine - Essential Language Features & Helpers - Basic Helpers - Strongly-Typed Helpers - Creating Custom Helpers - Declarative Helpers The MVC Pattern - The MVC Design Pattern - Working with Controllers - Model Templates - MVC State Management - Working with URLs and Routing (URL Routing) - Bundling and Minification Working with Controllers - Controller Actions - Controller and ActionResult Types - Passing Data from View to Controller - Action Filters & Custom Action Filter - Action Selectors HttpGet and HttpPost Razor Views - Razor View Engines and Syntax - Working with Layout Pages - Views & Partial Vi...
How to Edit More than 200 Rows in SQL Server 2008 Management Studio Step 1: In SQL Server 2008 Management Studio, go to "Tools" -> "Options" -> "SQL Server Object Explorer" -> "Commands". Step 2: Now in "Table and View Options" section, you can change either: #Value for Edit Top Rows command, to a value greater than or less than 200. #Value for Select Top Rows command, to a value greater than or less than 1000. Step 3: By specifying a value of 0, SQL Server will return all rows. (If you sql tables are really large data volume, you should NOT set these values to 0.) Step 4: Click OK to save your changes.
1. Clas s is Reference types and Structure is Value type. 2. Clas s supports an Inheritance where as Structure not. 3. Classes are usually used for large amounts of data, whereas Structure are usually used for smaller amount of data. 4. When we instantiate a class, memory will be allocated on the heap and when Structure gets initiated it gets memory on the stack. 5. Classes can have explicit parameter less constructors. But Structure doesn't have this. 6. Classes can be garbage collector because garbage collector works on heap memory . structures can not be garbage collector so no memory management.
Comments