Problem debugging

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.
9/30/2006 6:28:55 AM
Gravatar
Total Posts 73

Problem debugging

Hi Joe,

After installing 2.1.3, I cannot properly run the VS2005 debugger. When I start in debug-mode, I end up somewhere with errors in

Brettle.Web.NeatUpload.UploadHTTPModule

line 311: log4net.ThreadContext.Properties["url"] = app.Context.Request.RawUrl;

An exception of type 'System.Web.HttpException' occurred in System.Web.dll but was not handled in user code

Additional information: Kan de query-tekenreeks niet ophalen.

Any ideas?

Jan

9/30/2006 6:50:16 AM
Gravatar
Total Posts 18439

Re: Problem debugging

Hi Jan,

NeatUpload is an HttpModule that wraps the HttpWorkerRequest so pretty much any unhandled error looks like a NeatUpload error but usually it does not come from NeatUpload.

If you comment out the NeatUpload HttpModule in Web.config you can track down the original source of the error:
<!--
    <add name="HttpUploadModule" type="Brettle.Web.NeatUpload.UploadHttpModule, Brettle.Web.NeatUpload" />
-->

Hope it helps,

Joe
9/30/2006 8:08:57 AM
Gravatar
Total Posts 73

Re: Problem debugging

OK,

I changed that. Thanks

The problem I am trying to solve is  this:

Yesterday I did a clean install of mojoportol. I added my own code to it and did a recompile. Now certain modules that have got onselectedindexchanged= ..... in the webpage do not work properly. Others where I am defining this in de code stil work properly.

I used to define this stuff in the cs-files (as did VS2003) but when I converted these modules to VS2005 a lot of these things were deleted in the conversion and sometimes added to the webpage files. It took me a couple of days to get it fixed. In some of the modules that did not work, I just copied the old code in again.

Now I could do this for the current non-working modules as well, but I think it is strange that the onselectindexchanged=... does not work.

Any ideas?

Jan

9/30/2006 8:18:10 AM
Gravatar
Total Posts 18439

Re: Problem debugging

Most of the mojoportal pages and controls have a page directive like this:

AutoEventWireup="false"

So the events are wired up like this:

protected override void OnInit(EventArgs e)
{
    this.Load += new EventHandler(Page_Load);
    this.btnCreateInitialData.Click += new EventHandler(btnCreateInitialData_Click);
    base.OnInit(e);
}

You might check your custom stuff and see if the events are not wired up.

another factor that might be the cause is now in Default.aspx.cs we have:
this.EnableViewState = false;
which reduces the viewstate where its not needed and keeps the page lightweight for faster performance, but modules that need to have viewstate and for postback should add a line like this in page load of the module to turn viewstate back on:
Page.EnableViewState = true;

Joe
9/30/2006 8:38:32 AM
Gravatar
Total Posts 73

Re: Problem debugging

Hi,

I turned the viewstate on in default.aspx.cs. That solved the problems I encountered. Perhaps you can put the viewstate-setting in web.config and than use that value in default.aspx.cs. In that way, I do not have to make changes to the code.

Probably using the viewstate is not the neatest solution. I use it when I let a customer do a selection of an item in a datagrid / list (normally in an ascx). I store an identifier for selected item in a session-variable and than do a redirect to an aspx where I build up the necesary data based on the content of the session-variable.

Are there better ways of doing this?

Regards,

Jan

9/30/2006 8:45:15 AM
Gravatar
Total Posts 18439

Re: Problem debugging

Its ok to use viewstate when you need it. I want to keep it that way in Default.aspx because the majority of built in modules don't need viewstate and it can really reduce the page size a good amount.

Using a web.config setting would make it either have viewstate always on or always off which is not the desired outcome. The desired outcome is that viewstate is off on pages that don't have modules which need it and on for pages that have modules that do need it. Since the page object can't know what the module needs I leave it to be a responsibility of the module to turn it back on when needed. I do take blame because I should have documentation for this for module developers. Its just one line of code to add in page load of any module that needs its so I would recommend adding that line rather than removing it from Default.aspx.cs.

Joe
9/30/2006 9:15:35 AM
Gravatar
Total Posts 73

Re: Problem debugging

Ok Joe, I'll put it in my own modules.

As far as I know,you'll allways need a viewstate for postback. This is necesary when you use fill-in forms, datagrids with paging etc. Do you put it on for the forums to support paging?

Jan

9/30/2006 10:09:02 AM
Gravatar
Total Posts 18439

Re: Problem debugging

No not in the forums module except in ForumPostEdit.aspx. I do paging with querystring params. I use postback in any situation where I need to but I avoid it when I can or at least try and get out of postback with Response.Redirect(Request.RawUrl) at the end of the postback request to avoid page refresh issues that can happen if a user refreshes a page after postback.

Most of the module controls just link to an edit page where postback happens. Blog uses postback for Calendar navigation though I would like to somehow change that to linked navigation. EventCalendar also uses postback as does FileManager.

Joe
9/30/2006 10:33:22 AM
Gravatar
Total Posts 73

Re: Problem debugging

Joe,

I changed the line in Default.aspx back to false, Then I added this.EnabelViewState = true in the pageload of each of the ascx modules I have build. It does not change  the behaviour; the same problems I had occur. Apparently, changing the ascx does not work, because it is a usercontrol. I can only add it to an aspx, but than I cannot use standard paging in my ascx-files.

Perhaps it is better to add it to the web-config. You set it to false and use it when you need it. I change it to true, because I need it almost all the time.

Regards,

Jan

 

9/30/2006 10:40:13 AM
Gravatar
Total Posts 18439

Re: Problem debugging

Postback and Viewstate are working in my modules that postback and they are user controls so something else must be going on.

A couple of things you could try, try putting the Page.EnableViewState = true in OnInit of the module, though it works for me as the very first line in Page load of the module.
You might also try adding a line:
this.EnableViewState = true;
to make sure Viewstate is enabled on the module control itself.

If neither of those work then we can add a config setting DisablePageViewStateByDefault which I will set to true and you can set to false.

Joe
9/30/2006 10:56:47 AM
Gravatar
Total Posts 73

Re: Problem debugging

Sorry Joe,

Neither works for me.

It would be great if you could add it to the config.

Thanks,

Jan

9/30/2006 11:02:06 AM
Gravatar
Total Posts 18439

Re: Problem debugging

Ok, no problem I'll add it to my svn sandbox version now and if you do the same it should be fine for the next release.

Cheers,

Joe
9/30/2006 11:10:47 AM
Gravatar
Total Posts 73

Re: Problem debugging

Hi Joe,

It appears to be working when I add true;

to the pageload section. It does not work when I use this.EnableViewState anywhere in the code or Page.EnableViewState on another point.

So, you can keep it as it is, although I think it is better to parameterize it in web.config.

Thanks,

Jan

Page.EnableViewState =

9/30/2006 11:17:24 AM
Gravatar
Total Posts 18439

Re: Problem debugging

Yes, isn't that what I originally said? Add Page.EnableViewState = true; to Page load of module

In any case I've committed it to svn with the config setting and I'm happy to leave it in there. I put some comments in there about what its for and when to set it to false.

Cheers,

Joe
9/30/2006 11:27:20 AM
Gravatar
Total Posts 73

Re: Problem debugging

That was a misinterpretation of mine.

Sorry;-)

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