AutoEventWireup

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/2/2010 2:27:25 PM
Gravatar
Total Posts 131

AutoEventWireup

I'm chasing a bug and I'm not sure if it's related to the AutoEventWireup. In my controls (I have several nested), I have autoeventwireup set to false. In the Master.layout, autoeventwireup="true"

The pageload event is firing twice for each control.

My questions. if the autoeventwireup in the master is set to true, will all page_load events always fire?

When I set my autoeventwireup="false" in the master, my layout changes. My guess is that mojo requires autoeventwireup in the master to be set to true. Is that the case?

8/2/2010 2:37:11 PM
Gravatar
Total Posts 111
Matt Millican InternetMill

Re: AutoEventWireup

I'm not sure if it will help, but I'm pretty sure that all my controls and pages for mojoPortal have AutoEventWireup set to true.  Same for most of my web apps, minus a few random things here and there.

Not sure why it would fire the page_load twice though.

8/2/2010 2:49:42 PM
Gravatar
Total Posts 18439

Re: AutoEventWireup

Hi David,

Yes it needs to be true in layout.master

No, it doesn't propagate beyond layout.master so if the page load event in one of your controls is firing twice the cause must be internal to the control.

Note that if you've copy/pasted code from elsewhere in mojoportal code when starting your own controls, I typically do use AutoEventWireup="false" and I wire up the events in OnInit.

So if your .ascx file has AutoEventWireup="true" but you have the events also wired up in OnInit, then it will fire twice. So my guess is you do have it wired up in your code behind and you just need to remove that code.

Hope that helps,

Joe

8/2/2010 3:24:15 PM
Gravatar
Total Posts 131

Re: AutoEventWireup

Nevermind. I found the cause of my bug and it's not related to the page_load event anyway. 

 

But thanks Joe for the answer. Helps me understand it better (although all my autoeventwireups are false and I load in the onInit).

1/7/2011 10:27:06 AM
Gravatar
Total Posts 3

Re: AutoEventWireup

Sorry to dredge up an older, only somewhat related thread, but I am having a strange issue with setting AutoEventWireup to "true" in Default.aspx.

 

I am trying to use the built-in Contact Form feature, but .Net complains that I need to set AutoEventWireup on this page. It is enabled in layout.Master, but disabled in Default.aspx. After setting AutoEventWireup to "true" in Default.aspx, the left and right columns appear even with no content in them. This drastically changes the layout on pages where I am only using the center panel.

 

I'm using version 2.3.5.8b on the 3.5 framework, with no custom controls.

1/7/2011 10:33:57 AM
Gravatar
Total Posts 18439

Re: AutoEventWireup

you should not be modifying mojoPortal code nor changing the autoeventwireup in any existing pages or controls

If you are not using custom code then why did you post in the developer forum? This forum is about working with the source code and development in Visual Studio.

If you are getting an error with unmodified code you should post the error detail. Telling me that .NET complains does not give me anything to go on.

Best,

Joe

1/7/2011 11:04:56 AM
Gravatar
Total Posts 3

Re: AutoEventWireup

This topic came up in search results both on this site and Google. I was modifying source code in Visual Studio at the time I looked at the word "Developer" in the breadcrumbs for the forum. So, my mistake.

I was able to solve my problem, however. There was an errant form element in my layout.Master. Removing this allowed the Contact Form to work properly.

Looking back at the forum topics, I now see the large, bolded text that warns users not to post design-related questions in this forum. I'm sorry that this is marginally design-related; I'll post an entirely new topic in a different forum if that's necessary, but I am still curious: why would changing the AutoEventWireup property force visibility of the left/right panels? Is this something I would need to be concerned about when creating my own controls?

1/7/2011 11:21:19 AM
Gravatar
Total Posts 18439

Re: AutoEventWireup

  am still curious: why would changing the AutoEventWireup property force visibility of the left/right panels? Is this something I would need to be concerned about when creating my own controls?

Its because events in mojoPortal pages and controls are already wired up correctly from code so what happens if you change autoeventwireup to true on my existing pages or controls when the events are already wired from code is that the events fire twice and this breaks things

In your own controls you have your own choice whether to use autoeventwireup="true" or whether to wire up events yourself from code and it is not impacted by other controls.

Hope it helps,

Joe

1/7/2011 11:58:08 AM
Gravatar
Total Posts 18439

Re: AutoEventWireup

wow pixelbath you're a real jerk, I just saw your tweet, good luck to you I won't be spending another second of my time helping you any further.

1/7/2011 4:10:15 PM
Gravatar
Total Posts 3

Re: AutoEventWireup

You know, you're absolutely right. That was pretty low and I apologize.

I was frustrated, and misdirected that at you. I really do have a great deal of respect for the product, and I'm continually amazed at the amount of support you provide your users.

For what it's worth, I deleted the tweet and do sincerely apologize again. I wish you the best of luck.

1/7/2011 4:17:28 PM
Gravatar
Total Posts 18439

Re: AutoEventWireup

Thank you and apology accepted, really I was surprised because you basically seemed like a cool guy checking out your twitter and web site, and I'm glad to know you really are. Twitter is a dangerous place to vent, people see that stuff, but it is understandable and forgivable ;-D  We're cool, all forgiven on my end. 

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.