473,320 Members | 2,193 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.

I don't understand this

hey

asp.net 2.0

if I add the code below as the code executed when a button is clicked, then
a menu item is added to the menu. But if I add the same code to the
Page_Load event of a webpage, the menu item isn't added

Here is the code:
MenuItem menuItem = new MenuItem("Menu item text", "menuitemvalue",
"imageurl", "navigateurl");
Menu1.Items.Add(menuItem);

Any ideas why this don't work in the Page_load event?

jeff
Jul 24 '06 #1
2 899
http://msdn.microsoft.com/library/de...nLifecycle.asp

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.
"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
hey

asp.net 2.0

if I add the code below as the code executed when a button is clicked,
then a menu item is added to the menu. But if I add the same code to the
Page_Load event of a webpage, the menu item isn't added

Here is the code:
MenuItem menuItem = new MenuItem("Menu item text", "menuitemvalue",
"imageurl", "navigateurl");
Menu1.Items.Add(menuItem);

Any ideas why this don't work in the Page_load event?

jeff

Jul 24 '06 #2
Sorry to thread hijack but what i am having trouble with is at what point in
that process are databound controls populated with the values from the data
source?

"Kevin Spencer" wrote:
http://msdn.microsoft.com/library/de...nLifecycle.asp

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

What You Seek Is What You Get.
"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
hey

asp.net 2.0

if I add the code below as the code executed when a button is clicked,
then a menu item is added to the menu. But if I add the same code to the
Page_Load event of a webpage, the menu item isn't added

Here is the code:
MenuItem menuItem = new MenuItem("Menu item text", "menuitemvalue",
"imageurl", "navigateurl");
Menu1.Items.Add(menuItem);

Any ideas why this don't work in the Page_load event?

jeff


Jul 24 '06 #3

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

Similar topics

4
by: Bart | last post by:
Hi all I don't understand globals between multiple modules in a python program. I really don't. I've narrowed it down to the following two very simple programs a.py and b.py. When I run a.py I...
40
by: komone | last post by:
"Now is the time for all good web developers to use stylesheets". Hmm OK, so I start this commercial site design with the express intent of using CSS entirely. (Something I haven't attempted in...
7
by: Robert Nicholson | last post by:
So I've got one page where I have an image inside a DIV with text-align: center and the image is correctly centered in that block. Making me think that text-align will center the contents of a...
3
by: Lars | last post by:
Hello I write all my applications in VB6-- and I don't understand the reason to move to .NET (other than MS might break VB6 apps in future updates). I'm taking the position that I don't...
20
by: Sam | last post by:
Hi I'm learning to code with C++ and wrote some very simple code. I think it's consistent with every rule but always got compiling errors that I don't understand. The code include 5 files as...
16
by: Jace Benson | last post by:
Ok I have read alot of things on zend.com, php.net and other sites went to the wikibooks to try to understand how to use a class. I have this project I want to do that I am sure would work great...
31
by: Jo | last post by:
class A { public: char text_a; A() { *text_a=0; } ~A() {} }; //-----------------------------------------------------------------------------
21
by: jehugaleahsa | last post by:
Hello: I had an hour-long discussion with my boss today. Last night, right before I dozed off, I realized some of his code resulted in duplicate processing. I tried to explain it to him and he...
3
by: Ben Thomas | last post by:
Hello, I have the following code which I don't understand why it works : #include <iostream> using namespace std; void DontWork (unsigned int& i) { cout << i << endl; }
2
by: None | last post by:
Hi All These code are part of Prototype. There are something that I don't understand, would you please explain it for me? ....... toJSON: function(object) { var type = typeof object; switch...
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
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...
1
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...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.