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...
Send Email using Gmail SMTP server-ASP.NET What is an SMTP server? (pronounced as separate letters) Short for S imple M ail T ransfer P rotocol, a protocol for sending e-mail messages between servers. Most e-mail systems that send mail over the Internet use SMTP to send messages from one server to another; the messages can then be retrieved with an e-mail client using either POP or IMAP. In addition, SMTP is generally used to send messages from a mail client to a mail server. This is why you need to specify both the POP or IMAP server and the SMTP server when you configure your e-mail application. Let's see one example in ASP.NET 2.0 (Web Application) In WebMailSend.aspx.cs file You have to import this namespace for MailMessage. using System.Net.Mail; protected void btnSend_Click( object sender, EventArgs e) { try { MailMessage mail = new MailMessage(); mail.IsBodyHtml = true ; mail.To.Add(txtEmail.Text); mail.Subject = txtSubject.Text; mail....
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
we are going to see how to generate sequence number (row number) in DataGrid. To generate sequence number, we will use the DataGridItem’s ItemIndex property. But For example if we are going to second page with Pagesize 3, then sequence number should start from 4. Code snippet for implementing this method is... < asp:DataGrid id ="DataGrid1" runat ="server" PagerStyle-Mode ="NumericPages" PageSize ="10" AutoGenerateColumns ="False" AllowPaging ="True" > < Columns > < asp:templatecolumn headertext ="Row Number" > < itemtemplate > <% # (DataGrid1.PageSize*DataGrid1.CurrentPageIndex)+ Container.ItemIndex+1 %> </ itemtemplate > </ asp:templatecolumn > < asp:boundcolumn runat ="server" Da...
Back to Home Model-View-Controller (MVC) is a software architecture pattern. Originally formulated in the late 1970s by Trygve Reenskaug as part of the Smalltalk, MVC architecture works on code reusability and separation of concerns. It was originally developed for desktop Then adapted for internet applications. The Model is the application object, the View is UI presentation, and the Controller defines the way the user reacts to user input from UI. MODEL: - Set of classes that describe the data we are working with - Rules for how the data can be changed and manipulated - May contain data validation rules - Often encapsulate data stored in a database as well as the code used to manipulate the data Most likely a Data Access Layer of some kind VIEW: - Defines how the application’s user interface (UI) will be displayed - Support master views (layouts) - Support sub-views (partial views or controls) - Web: Template to dynamically generate HTML CONTR...
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...
i want create a Procedure that behave like this: declare @cnt int set @cnt =10 select top @cnt * from sw_user Where sw_user contains 20 records, and i want the variable to be the criteria of Top statement. so i can use this for a solution for this type of problem CREATE PROC Top10 @cnt int AS SET ROWCOUNT @cnt SELECT * FROM sw_user but some cases ROWCOUNT might not be work... so what, Note : This statement however is possible in SQL 2005, just add "()" in your variable like so: declare @cnt int set @cnt =10 select top (@cnt) * from sw_user
Back to Home ASP.NET MVC 1.0 | .NET Framework : 3.5 | Visual Studio: 2008 Released on 13 March 2009 WebForm View Engine HTML Helpers View Data URL Routing Partial View Action Filters ASP.NET MVC 2.0 | .NET Framework : 3.5 & 4.0 | Visual Studio: 2008 & 2010 Released on 10 March 2010 Data Annotation Async Controller ASP.NET MVC 3.0 | .NET Framework : 4.0 | Visual Studio: 2010 Released on 13 January 2011 Razor View Engine View Bag ASP.NET MVC 4.0 | .NET Framework : 4.0 & 4.5 | Visual Studio: 2010 & 2012 Released on15 August 2012 WebAPI Bundling & Minification DB Migration Mobile ASP.NET MVC 5.0 | .NET Framework : 4.5 & 4.5.1 | Visual Studio: 2013 Released on17 October 2013 Bootstrap ASP.NET Indentity Back to Home
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.
Comments