472,345 Members | 1,519 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

UserControl OnInit not firing

Hi, All,

I'm having problems getting OnInit to fire in my
UserControl, when I use a custom template to render the
control. The control will render to the browser and it
wasn't until I needed to perform some initialization in
the OnInit event did I realize that this event was never

Two Question:
1. Why Isn't OnInit firing in the UserControl class
2. Why am I getting a NullReferenceException when I
try to assccess mMenubar after I Load the UserControl
in the Somepage class? The way I understand it is
this should Get initialized before OnInit is fired in
the UserControl Class. Obviously this isn't so!
************************************************** ********
//Template class
Public Class myTemplate : Page
Control vMenubar;

Public Control VMenubar
get{Return vMenubar;}
Set{vMenubar = value;}

protected override void Render(HtmlTextWriter write)
Nov 18 '05 #1
1 2128
Hi Neil,

Thank you for posting to the MSDN newsgroups.

I noticed that you have posted the same question in this group. I have
replied you on that thread. Please check it when you have time.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #2

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

Similar topics

by: jralford | last post by:
Hi, Another question from a C# newbie: I have a usercontrol class that includes a customized control. Now, if I create an instance of the class,...
by: Andy | last post by:
Visual Studio 2003 web form problem using C#. My Page_Load or OnInit routines seems to be called twice for every post back to the server. I...
by: | last post by:
Hi, All, I'm having problems getting OnInit to fire in my UserControl, when I use a custom template to render the control. The control will...
by: Colin Ramsay | last post by:
Hi all, I don't normally post swathes of code like this but I am truly banging my head off my desk here... I've dynamically created a...
by: Patrick | last post by:
Problem I have an ASPX file, with a table of 3 columns, 2 rows with a usercontrol in the middle column (in the code snippet stated below,...
by: Sean Kraft | last post by:
Hello, I am generating a PDF and writing its bytes to the browser using Response.BinaryWrite(). Before I do this I set the response.contenttype...
by: Kepler | last post by:
I have a custom control that is thrown onto a UserControl that is thrown onto a WebForm. Basically, I've got a scenario where if my UserControl...
by: seal | last post by:
OK, I am trying to fire an event from a usercontrol that tells the page when a checkbox was clicked. Here is the control and when I try and wire...
by: jasinx | last post by:
When I run this code it creates a button on an .aspx page. When I click the button it seems to fire the events but I'm unable to capture them in...
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

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.