You need to Register for free and Login to post a message in the forum.

Forum

Subject: PostBack Problem
Prev Next
You are not authorized to post a reply.

Author Messages
cyborama
Nuke Pro
Nuke Pro
Posts:91

19 Jun 2008 2:51 PM  
Hello there Joe or Lee,

I have been trying to implement some dynamic body color changes and graphic changes based on an onclick event.  I have tested my javascript functions seperately and they seem to run without incident.  The problem is when I put these two functions in the head section of a dotnetnuke page together as they need to be I get the famous postback error.

What actually happens is when I add the getElementById method to one of my functions when I update the page with these functions in the area you are supposed to put information that would go in the head tag some of my script gets cut off.

Particularly the closing script tag and sometimes the curley brace that closes the last function I put in the head section. 

This seems to happen only when these two functions are used together in the head section on the same page and with that getElemntById method in the changecolor function.

This is really a bizarre issue and after such a thing happens I cannot do anything on that page be it log in, log out, go back to settings, edit a text module, what I can do is click on another page and than when I click on something like log in I am able to log in and manipulate that page but just as soon as I get back to the page where that script was on I can do nothing.

I even tried to go to admin>pages and select edit on the page that seemed to be corrupted and it let me get to the pages details with the ability to set permissions for the page, etc... but when I went to update my changes I got that same postback error and so the only option I had was either delete this page and recreate it or simply restore the database from a backup that was made before this happened which is what I have been doing since I backed up a couple instances of the database before I make the change and than restore it when it malfunctions again.

I just didn't know if you haave had experience with this kind of thing.  Also it might be noted that even when you put css styles in that area of a page when you click on update DNN may or may not cut off the end tag or an end curly brace, etc... and if it does cut some of this scripting off be it CSS or Javascript you will almost always than not be able to login to that particular page or edit exsiting modules on that page if you are somehow logged in.

It almost seems like when you add code in the head section of a page by going to setting >advanced settings and typing info in the field that says page header tags it is like playing Russian rollet because sometimes things end up being fine and other times you get pieces of your scripts truncated and your page becomes useless for editing.

If you can give me any help on where I should add things that go into the head section of a page that won't risk causing postback errors after you update that would be great.  I don't know if an ascx file of the skin has some place in it where you can call a head tag and have it sync up to the actual head area when DNN generates the page or not but this could be a draw back if anytime you want to add some style to the head section or javascript functions you have to guess as to eather or not the page will corrupt or be ok.

Thanks,

Bo
cyborama
Nuke Pro
Nuke Pro
Posts:91

20 Jun 2008 12:10 AM  
Beware DNN Users concerning the head section of your DNN Pages. I have fully experimented with this problem today and found that it appears there must be a bug in DNN concerning this area of the environment because if I put around 470 characters or so with no spaces I seem to not run into this truncating problem where DNN decides to truncate part of the end script tag or even more but if it is much beyond this for character length not counting white blank lines or spaces you could be in danger of getting the fatal crippling error do to DNN truncating part of the script in the head section.

I have labored a few a wasteful hour restoring databases do to this problem. I ran into it when putting CSS info in this section or Javascript function in this section or just about anything that needs putting in this section should not exceed I would say 415 characters or so just to be on the safe side.

If you are not sure about the word count of a script needing to go in this section I have just started creating a test page in my portal where I can dump the questionable script and if it erros out and lets me not be able to get post backs from the database than I can simply just go to Admin>pages and find that page that way and click delete. Since this would be a tes page anyway there really is not a lot of time loss except the time it takes to delete the test page and create a new one. This should be done until you get a function script in the head section to work properly without giving the postback error problem than just transfer it to the page in which you have calls to those functions within given modules and you should be ok.

Trust me I learned this the hard way having to spend countless hours restoring both remote development servers (which was excruiating and some time spent doing the same to localhost which wasn't near as bad since I didn't have to wait the length of time it take to reupload all the files back up to the server since it is just on my local drive.


But if this issue hasn't been reported to DNN core team as a bug it needs to be because it is a bug to anyone who is trying to create some custom script like I was to effect a container div id color upon clicking on a given area of the website.

One question that still lingers though is if there is any global way of telling dotnetnuke to target the _parent attribute of any module on a given page. While this is simple enough with the text/html module with some of the third party vendors like the slideshow module or live content module by mandeeps this is not quite so intuitive and since their is no config on the module for this I am not sure how to set target to _parent on say the live content slideshow.

This is needed for me because I contain three sections in an iframe with broad choices within a section. Than the user can select a specific video say to click on in the iframe or a specific blog, etc... and it should break out of the iframe and give the visitor that info in the same page or new page bu outside the iframe box. with a _self target which the livecontent slideshow seems to do it will just target the iframe container since it is self contained in that the way it is designed so any ideas on this would be great as well. I have emailed mandeeps concerning this but as of yet have not gotten a response.

Bo
leesykes
DNN Creative Staff
Nuke Master III
Nuke Master III
Posts:3375

20 Jun 2008 3:30 AM  
Hello,

Interesting info, this is not something I have experimented with, so I would report it to the DNN core team as a bug and see what they say.

Hopefully mandeeps will get back to you with a solution for that as it will probably have to be programmed into the module.

Thanks,

Lee

Lee Sykes
Site Administrator
Subscribe to the website : DotNetNuke Video Tutorials : The Skinning Toolkit : DotNetNuke Podcasts

Twitter: www.twitter.com/leesykes

Lee Sykes's Facebook Profile
jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2371


20 Jun 2008 6:00 AM  
The PageHeadText column in the Tabs table is limited to 500 characters, as are Description and Keywords.

Into which field are you pasting the code? It appears to me that PageHeadText is the field that corresponds to Page Header Tags on the Page Settings page.

Have you tried pasting the required Javascript into a header or footer for a module. You could try putting a Text/HTML module on the page and put your Javascript there. Those fields use ntext and are unlimited in size.

Joe Craig
DNN Creative Support
Subscribe to the website
jncraig
DNN Creative Staff
Nuke Master II
Nuke Master II
Posts:2371


20 Jun 2008 6:06 AM  
I found some prior discussions about adding javascript to DotNetNuke pages ...

http://www.dnncreative.com/Forum/tabid/88/forumid/4/postid/1600/view/topic/Default.aspx
http://blogs.snapsis.com/PermaLink,guid,eef98c82-f54d-480b-8e36-309ca6e406d8.aspx

You can find more by googling ...

Joe Craig
DNN Creative Support
Subscribe to the website
cyborama
Nuke Pro
Nuke Pro
Posts:91

20 Jun 2008 7:20 AM  
Hello jncraig I tried the google thing but couldn't really come up with a lot maybe I used the wrong keywords but in response to the idea of adding Javascript to a text/html module I have done this in the form of function calls.

For example it is a text/html module that I call a function from using an onclick handler but my concern with using a text/html module for the actual function itself is could I call it just the same.

In other words if I had an text/html module that had function doodle and than some statements and function doodler plus some statements would it be possible than from either the same module with the function calls or another module to call that function with an event handler and pass that function some info like hex numbers, id strings, etc...

I am just not sure if a structured javascript function could be called by an event handler found in an text/html module if that function was put into either the same module or a different one than what houses the calls to that function other than it being in the head section of the page which is typically where you put all your Javascript functions that are called by onclick evernts or other types of events with in the body of the text.

Any more insight in this would be wonderful as it certainly would break that 500 character limitation cycle that can easily be exceeded if you just one page that needs some complex functions in it in order to do some customized things like I was trying to do.

Thanks again

Bo
You are not authorized to post a reply.



ActiveForums 3.7

Latest Forum Posts

Restricting DateEditControl till date by coder247
Hi All,   We are using the DateEditControl (for obvious reasons!!) in our application. But we want t...
RE: Email Set UP per Portal by jncraig
I think that the answer depends on how email is configured at your host. You'll probably have to co...
RE: skin/container error load by jncraig
I would suggest checking permissions for directories. Does this occur only when you upload a skin...
RE: Add New Profile Properties by jncraig
Hmmm ... I don't have an answer. Does anyone else?
RE: No Access for me too by ristori
it is ok now. Thanks for this action.
skin/container error load by islandman
Has anyone else run across this error when loading skins or containers from site settings?I am using...
Email Set UP per Portal by islandman
How do I set up a unique email address per domain name off 1 hosting environment. for example...m...
RE: localhost Install issues by cdees
Lee: I wanted to follow up on this for anyone following this thread. I have been unable to solve t...
RE: Add New Profile Properties by WSI
HI Joe, The DNN version is 4.5.5. Thanks, Cliff
Change Skin on URL by vinita
Hi,Can the skin be changed based on the url used to access a portal. Multiple portal aliases may be ...
problem creating child portal by kabamaro
  Hello all i have 4 Aliases for my parent portal , lets call them X,y,Z,WIn all Aliases i can creat...
problem creating child portal by kabamaro
  Hello all i have 4 Aliases for my parent portal , lets call them X,y,Z,WIn all Aliases i can creat...
Best DNN portal ever! by derpir
I have been a subscriber since august 2008, and DNNCreative.com is simply the best DNN Portal, their...
RE: skinning trouble by derpir
Hello Yes could you be so kind and take a look att the htm-file and css-file.I would be very gratef...
Search function is not working by kishorpawar
I am using Seach module in my project but not working, i have set   host setting alsoHost --> Schedu...
RE: backend is changing from sql2005 to sql2008 by leesykes
hello,There should not be any code changes needed, but you'll need to make sure that SQL 2008 upgrad...
RE: skinning trouble by leesykes
Hello,I would need to see your code to help you with this one, you can zip up your files and attach ...
RE: Installing DotNetNuke 4.9.00 on VWD 2005 w/ SQL server 2008 by leesykes
I have run a test with SQL Server 2008 express and DotNetNuke installed in exactly the the same way ...
RE: Issue 39 Interview by leesykes
thanks Bill, glad it was useful, we will have a think about the best way to approach this,Thanks,
RE: Issue 39 Authentication by leesykes
yes I have a live site in 4.9.0 at it seems stable as well.
AppTheory
RSS Feeds