page-lifecycle

building dynamic controls on postback (asp.net)

I'm sure this has been answered but I cannot find it...perhaps because the terms are used for so many differing questions...anyway. how is the best way to store information about building dynamic controls on postback etc in the init event... e.g. take the classic "questionnaire" scenario...question.aspx?id=1 get the id from the que...

When to fire a custom control event?

Hello, I am creating a custom control. Let's say I'm reinventing the wheel and creating a custom Button control that derives from the UserControl class(only for example) Well, it of course has a Click event handler. Now my problem is, when do I call this event handler? I know it happens sometime between the Pages OnLoad and OnLoadComple...

What are the events triggered after clicking on a href link in a .Net application?

My client wants to pass values through the query string, but they don't want the query string to be displayed in the browser's address bar. The values being passed are for tracking purposes. I know that postback doesn't happen after you click on href link. Is there any way I can get the value out of the query string without displaying i...

Why aren't all controls initialised at the event handling point of the ASP.NET page lifecycle?

I have a user control embedded in a web part. It has the following snippets of code: protected TextBox searchTextBox; protected Button goButton; protected Button nextButton; protected Repeater pushpins; protected Label currentPageLabel; protected void goButton_Click(object sender, EventArgs e) { // Do stuff } <asp:TextBox ID="searchT...

What happens when I press browser BACK button?

Consider the scenario: I visited a page of a website built using ASP.NET. The page is a simple aspx page containing ASP.NET server controls. I clicked on a link which takes me to some other page on the same website. I clicked the BACK button of the browser. QUESTION: What happens in terms of page life cycle? Does all the events occu...

Selecting item in incapsulated DropDownList on DataBind

I have a complex UserControl with the main purpose to encapsulate DropDownList with a number of properties for advanced manipulation. List is being populated on PreRender event depending on properties previously were set: protected void Page_PreRender(object sender, EventArgs e) { sourceClient.SelectCommand = this.Property1 ? "exec...

Is there a function called anytime ANY page is loaded in your application?

I want to be able to run a script anytime ANY page is loaded in the application. Is there somewhere I can simply add this? Or do I have to add the code in every page load? ...

ASP.NET event lifecycle for inherited user controls

Please forgive the psuedo-code, but it's a simple question: I create a user control (myControlBase : UserControl) with a textbox (id = "txtbox") in it's markup. In it's codebehind I write a method SayHello(string s){ txtbox.Text = s; }. I create another user control that extends myControlBase (myControl : myControlBase). In page_lo...

Accessing Request or Response OnUnload() ?

I want to store a cookie using something like Response.Cookies.Set(new HttpCookie("name","value"); after I have finished the page lifecycle, so it makes sense to put it in the OnUnload() event. However at this stage, Request and Response have already been unloaded, so throw a null ref exception. Has anybody got any brain storms to ...

How long will an ASP.NET MVC application run

I wonder how long will an ASP.NET (MVC) application run, when no new requests come in? Lets say I'm using an IOC Container ans have a Singleton Object serving to the clients. As far as I know it will serve different page requests. But how long will it live when no new request come in? Is there any timeout (maybe configured through IIS) t...

ASP.NET MVC ,Maintaining Model State between Ajax requests

problem: On first full page request, my controller invokes an applicationServices Layer (Web Service Proxy to my business tier) in order to populate a collection of current services that is stored in my own controller base class property. This is then to be displayed within a view. Everything within the context of that controller has ac...

Can an ASP.NET user control determine its context or its parent .aspx file

Is it possible for a user control to determine its "context" or its parent .aspx page in some way? Right now I have a user control that is declared on a typical .aspx page as follows: <%@ Register TagPrefix="uc1" TagName="ManageTitle" Src="../UserControls/ManageTitle.ascx" %> The user control currently emits a textbox as follows: <a...

When a button is clicked, will then button's event fire before page_load?

When an asp.net button is fired, will the button's event get fired before the page_load and init and pre_init events? ...

Need Help with Page Life Cycle(I think it is screwing me up)

Hi I have dragged a empty asp.net table onto my webform. I generate all the rows in the code behind those. Now my table gets filled up and has dropdown lists. When the user hits save I go through all the rows and update the values from the dropdownlist in the db. This works all great. However if 2 columns have each have "Present" the...

How can I most accurately calculate the execution time of an ASP.NET page while also displaying it on the page

I want to calculate the execution time of my ASP.NET pages and display it on the page. Currently I'm calculating the execution time using a System.Diagnostics.Stopwatch and then store the value in a log database. The stopwatch is started in OnInit and stopped in OnPreRenderComplete. This seems to be working quite fine, and it's giving ...

Asp.net Page and control Events

I have looked all over the web and I can not find the information I am looking for and I was hoping that someone could give me a hand. Specifically, I am looking for a comprehensive list of what events occur in the page and control life cycles and what is "available" in each event. Like when can I get a dropdownlists selected value, wh...

jQuery Dialog causing buttons not to post-back

I'm using the jQuery UI Dialog() function on an ASP.NET webform, on a particular panel. After Dialog() is applied, the buttons become useless and will not post back at all; I'm not even getting a Page_Load event firing, let alone any button events. Is the Dialog function messing with my button events? If so, is there a way to fix this?...

Working with DataBinding and Page_Load in ASP.NET MVP

I'm using WebForms MVP to create some simple reporting applications. Most of these applications consist of a few search criteria inputs and a ComponentArt datagrid that I'm populating with data from the database. Most of the markup is in a UserControl, which is in a content page with a master page. My problem is that the control's Pag...

asp.net could a half submitted web page be processed?

Having a weird bug in production and just wondering if it's possible for a half submitted web page to processed by the server? The page has no view state just using plain old html controls and accessing data displayed in repeater on the back end via Request.Form[name] etc. Is it possible for a request to be truncated perhaps due to los...

what is the difference between postback data and view state data.

I am trying to understand different events in a Asp.net page life cycle. I came across to this link. It has two stages Load view state and Load postback data. I used to thought that these both means the same thing. But this article says, that postback data is not viewstate data. I don't understand this. If anyone can have a look. ...