problem with neatupload, page does not postback, and refreshes.

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.
3/5/2012 8:45:56 AM
Gravatar
Total Posts 192

problem with neatupload, page does not postback, and refreshes.

Hi.

I'm having a problem with neatupload.

I've put multifile and progressbar on a page.

(I have two similar pages that are using these controls. one works perfectly.

but the other one has problems. I wonder why that one doesn't work, they have just little differences.)

the problem is when I upload a file, the progress window is shown, but it will not close when it's complete, and sticks. also the page will not post back. the page will refresh instead of post back. if I reupload after page refresh, it will post back, but all fields of the form were cleared and the user faces an exception.

I do really need help, so any help is appreciated.

thanks.

3/5/2012 12:10:41 PM
Gravatar
Total Posts 192

Re: problem with neatupload, page does not postback, and refreshes.

Hi again.

in the second page that is not working I had changed OnPreInit and I think this is what had caused the problem, because after commenting it out, it became OK.

what does neatupload do in page pre init that overriding it will make the functionality fail?

3/5/2012 12:21:47 PM
Gravatar
Total Posts 18439

Re: problem with neatupload, page does not postback, and refreshes.

I'm very flattered that you think I can figure out the problem with your code without even seeing it but I am not all knowing.

What did you change in OnPreInit?

What did you comment out?

Have you set a breakpoint and stepped through your code?

3/6/2012 12:14:13 AM
Gravatar
Total Posts 192

Re: problem with neatupload, page does not postback, and refreshes.

Smile

I just wanted to know where to start!

I first thought that just overriding the page preinit had caused the problem.

but this is the code in preinit that is causing the problem:

((mojoBasePage)Page).MasterPageFile = SiteUtils.GetMasterPage(this, "x-profile", siteSettings, true);

there are some pages in the site that use this code (+others) to change the skin of the page. instead of using static master pages, I tried using this code, in order to be able to use stylesheet combining and scriptloader and other features in mojoPortal master pages.

what is the best practice in such scenarios where I need to use a skin with all the portal modules, but the page is not a cms page?

3/6/2012 12:46:40 AM
Gravatar
Total Posts 192

Re: problem with neatupload, page does not postback, and refreshes.

I'm trying to statically define the skin for the page, and I tried using

LoadSkinCss="true" OverrideSkinName="x-profile"

on stylesheetcombiner

but it doesn't work correctly on this line, throws an exception:

configFilePath = Server.MapPath(SiteUtils.DetermineSkinBaseUrl(SiteUtils.SanitizeSkinParam(overrideSkinName)) + "style.config");

(which is in AddCssLinks in stylesheetcombiner.ascx.cs)

and this is the exception:

'http:/mylocalsite.com:8091/Data/Sites/1/skins/x-profile/style.config' is not a valid virtual path.

(I tried a change, removing siteroot and this code

string skinUrl = "/Data/Sites/"
+ siteSettings.SiteId.ToInvariantString()
+ "/skins/" + skinName + "/";

in SiteUtils.DetermineSkinBaseUrl

works correctly, at least for me...)

I'm still working on this.

3/6/2012 3:05:19 PM
Gravatar
Total Posts 192

Re: problem with neatupload, page does not postback, and refreshes.

Hi joe.

did you check it? is it a bug with "OverrideSkinName" of stylesheetcombiner?

3/7/2012 7:00:48 AM
Gravatar
Total Posts 18439

Re: problem with neatupload, page does not postback, and refreshes.

Hi,

I've made the change you indicated in SiteUtils.DetermineSkinBaseUrl(string skinName)

However note that the only reason that code is executed is because you have

<add key="CombineCSS" value="false"/>

and there is really no good reason to do that, it makes it create separate links for each css file which is bad for performance and there is no control over caching when you do that because the  browser will cache static css files.

For supporting pages of a CMS plugin feature it is easy (with the latest code) to make the supporting page use the page specific skin (ie the skin selected in page settings on the cms page) like this:

protected override void OnPreInit(EventArgs e)
{
AllowSkinOverride = true;
base.OnPreInit(e);
}

If your page is not a supporting page of a cms plugin or if you are trying to hard code a specific skin I don't really have any advice for you about "best practices", whatever works for you is ok with me but it doesn't sound like something I would do myself.

Hope that helps,

Joe

3/7/2012 7:06:53 AM
Gravatar
Total Posts 192

Re: problem with neatupload, page does not postback, and refreshes.

Thank you Joe.

I'm still developing my web application, and that's why. (it's easier to do design tweaks with separate CSS files. )

3/7/2012 7:15:54 AM
Gravatar
Total Posts 18439

Re: problem with neatupload, page does not postback, and refreshes.

it's easier to do design tweaks with separate CSS files

I disagree, you have no control over browser caching of static files.

It is very easy now to reset the skin guid under Administration >Advanced Tools > Design Tools > Cache Tool.

Just click the button to reset the guid and you can be sure it will reload all the css using the combiner. You can click the button as often as needed ie after each change to any css. Or you can set a cookie with the other button to prevent caching.

Best,

Joe

3/7/2012 7:29:24 AM
Gravatar
Total Posts 192

Re: problem with neatupload, page does not postback, and refreshes.

you're great Joe, I wasn't aware of this feature, it really helps.

I used to not enable caching even when the web app was online, until all tweaking was done, but now it can be enabled at any time for the production server.

but I still have the problem which lead me to not enable combiner while designing and developing.

the problem of caching for the designer can be so easily solved by CTRL+ F5. so easy.

but when I need to change CSS for an element, it's hard to find the file it's residing in, but when combiner is not enabled, firebug shows which file needs the change.

3/7/2012 9:22:35 AM
Gravatar
Total Posts 2253

Re: problem with neatupload, page does not postback, and refreshes.

Hi,

If the multiple CSS files is making it difficult for you to find the elements/selectors, combine them all into one file. There is no requirement to have separate files. To do this, open your style.config and make note of the order in which the files are listed. Copy the contents of the files into a new file in the same order. Finally, remove all of the entries for the files you merged from the style.config.

For example, your style config may look like this:


<file>style.css</file>
<file>styleblog.css</file>
<file>styleforum.css</file>

Copy the contents of the styleblog.css file to the bottom of the style.css file and then copy the contents of the styleforum.css file to the bottom of the style.css file. Remove the entries for styleblog.css and styleforum.css from the style.config so it looks like this:


<file>style.css</file>

Now the style for the blog and forum are included in the style.css file so it should be easy to find the elements/selectors for those modules. You can do this for the rest of the css files in your skin.

HTH,
Joe D.

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