473,320 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Event wireup headache

I've been browsing through this newsgroup and I am yet to come across exactly
the answer I was looking for so, after a while, I figured I'd searched long
enough and hard enough to actually post.

My problem is simple: I have a search control - it runs a search and
returns a number of products - these products are displayed through a user
control. When the search is run the user can decide how many results they
want to see in the results pain.

When they reach the results page there is ANOTHER drop down which allows
users to change the number of results on the page.

What I want to know - and I've not found this succinctly anywhere else yet -
is what do I do and when during the page life cycle.

Currently my page runs as this:

Init:
Read initial results per page into rpp from query string
LoadControl() & ConfigureControl() x rpp;

Load:
Does very little;

Page posts back with RPP changed:

Init: Does notion

LoadViewState:
Read rpp from viewstate of dropdown control
LoadControl & ConfigureControl x new rpp

Load:
Does very little

The net result of this is that the events that most of the events in the
controls don't fire. They just don't seem bound. Now, the fact that some
work and some don't seems to indicate that I'm mussin up my view state
somewhere.

I'm lost now so I'll leave it down to you wonderful people to ask me
pertinent questions.

Cheers,
Joshua
Oct 2 '06 #1
1 1296
its pretty simple. on postback the order is as follows

preinit
onint
load viewstate
load postback data
form load
raise events
prerender
render

for a dropdrown to fire, it must see the value change. this means you need
it inital it on onint (or let it save save in viewstate). the event handler
must be added on or before form load.

-- bruce (sqlwork.com)

"Oddball" <Od*****@discussions.microsoft.comwrote in message
news:B7**********************************@microsof t.com...
I've been browsing through this newsgroup and I am yet to come across
exactly
the answer I was looking for so, after a while, I figured I'd searched
long
enough and hard enough to actually post.

My problem is simple: I have a search control - it runs a search and
returns a number of products - these products are displayed through a user
control. When the search is run the user can decide how many results they
want to see in the results pain.

When they reach the results page there is ANOTHER drop down which allows
users to change the number of results on the page.

What I want to know - and I've not found this succinctly anywhere else
yet -
is what do I do and when during the page life cycle.

Currently my page runs as this:

Init:
Read initial results per page into rpp from query string
LoadControl() & ConfigureControl() x rpp;

Load:
Does very little;

Page posts back with RPP changed:

Init: Does notion

LoadViewState:
Read rpp from viewstate of dropdown control
LoadControl & ConfigureControl x new rpp

Load:
Does very little

The net result of this is that the events that most of the events in the
controls don't fire. They just don't seem bound. Now, the fact that some
work and some don't seems to indicate that I'm mussin up my view state
somewhere.

I'm lost now so I'll leave it down to you wonderful people to ask me
pertinent questions.

Cheers,
Joshua

Oct 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Brian | last post by:
I am so happy to have mastered the technique for "Press Tab to insert". I type " += " and up steps Visual Studio to write my event handler for me. This is more fun than Intellisense. But I...
7
by: Oisin Grehan | last post by:
Hi, I have a UserControl derived class: <ns:votingbutton runat="server" id="btn1" onclick="votingbuttonclick" /> My question is, what code do I need in place in the codebehind for this to...
1
by: Maurice Walmsley | last post by:
hello and thanks I am as green as mold when it comes to asp.net, so please bear with me. I am trying to get an asp.net page with a webform to work using codebehind. My class/routines work...
1
by: Roger | last post by:
My page_load event doesn't fire if I close my browser and reopen it to the same page. Any reason why? Is there something I need to set in my web.config or global.asax? Right now, I don't have...
3
by: localhost | last post by:
In my ASP.NET page code-behind, I have added a textbox like this: (C#) System.Web.UI.HtmlControls.HtmlGenericControl div1= new HtmlGenericControl( "div" ); div1.ID = "divNewTextBox";...
3
by: csgraham74 | last post by:
Hello, Ive been working on an asp.net application in both dreamweaver and visual studio .Net. Ive imported files created in dreamweaver into my VS.Net application. The main problem that i...
6
by: Joseph Geretz | last post by:
I'm porting a C# Outlook Addin originally engineered as a COM Addin over to use VSTO. I've gotten this to the point where my VSTO Addin installs its Menu items and Toolbar buttons when Outlook...
6
by: Mark Chambers | last post by:
Hi there, Does anyone know why the "ColumnChanged" event isn't fired when "Merge()" is called below. "OnRowChanged()" is fired however: Thanks in advance. private static void Test() {...
5
by: Andrew Robinson | last post by:
I have a page that can load a number of different user controls. Each of these user controls inherits from a common base class and the controls are loaded based on application state, status, etc...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.