R2i DotNetNuke® Forum

R2i wants you to have the opportunity to ask questions, post reviews, help others or just rant and rave about DotNetNuke® or any of the R2i Modules and Skins. Our team spends hour upon hour, day after day, working on custom DotNetNuke® modules and services; please feel free to ask us anything.
 
How Do I Force A Full Form Post Back on DNN 4.7
Last Post 01 Jan 1900 05:00 AM by . 8 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Informative
RegGFXUser is Offline
New Member
New Member
Posts:10

--
21 Nov 2007 11:05 PM  
I have a special situation where I have a client (who’s web site use to be DNN 2.X) needs to have the ability to do post-backs.

This is because we have a small input box on the webpage where a user can submit hidden input to another DNN page with an IFRAME that links to an HTML page that accepts the submitted information from the simple input boxes.

My problem is that I have to carry over this feature from DNN 2.X over to a new site that is 4.7
And because DNN 4.7 is Ajaxing the entire page, I cannot do a traditional Form post-back to a HTML/ASP page inside an DNN Iframe. I get an error that reads

Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

Any suggestions on how to submit this info from my DNN Page to an HTML page inside of a DNN DNN 4.7 Iframe?
RegGFXUser is Offline
New Member
New Member
Posts:10

--
26 Nov 2007 07:20 PM  
I feel like I've stumped the forum on this one. Or i'm not explaining the issue.

Does anyone have an idea how i can attempt to force a Full Form Post Back on a DNN 4.7 version, like you could in early DNN 2.x versions?

Any help or suggestion as to a work around would be great!

Thanks.
robert_chumleyUser is Offline
Advanced Member
Advanced Member
Posts:592

--
26 Nov 2007 08:05 PM  
Hello RegGFX,
You are right, DNN has changed the way forms are submitted. We are aware of the problem and are currently writing a work around. We will be posting a patch shortly for DNN 4.7.
Thanks for the heads up,
Robert Chumley<br>r2integrated (formally bi4ce)
kevinmschreinerUser is Offline
Advanced Member
Advanced Member
Posts:729

--
26 Nov 2007 09:04 PM  
Actually- I'm going to need a sample of what you are trying to do. ListX is properly posting back in all places except for within Module Settings. This is because, the ListX module controls its own __dopostback and submit functions. The Module Settings fails because the form postback is wrapped inside of an AJAX Update container. What are you attempting that is having a problem?
kevinmschreinerUser is Offline
Advanced Member
Advanced Member
Posts:729

--
26 Nov 2007 09:05 PM  
Also - one additional note: If you need to have a control on your dotnet based module (not listx) post back as it did previously - you need to register it within the Script Manager as requiring a full postback:

If DotNetNuke.Framework.AJAX.IsInstalled Then
DotNetNuke.Framework.AJAX.RegisterScriptManager()
DotNetNuke.Framework.AJAX.RegisterPostBackControl(btnMyButton)
End If
kevinmschreinerUser is Offline
Advanced Member
Advanced Member
Posts:729

--
26 Nov 2007 09:10 PM  
Additionally - if you are stuck in a scenario where you need to do that postback but CANNOT reference the most recent version (4.7) of DNN or greater within the code - meaning the Framework.AJAX doesn't exist - don't fret. You can do this with reflection. Our code base requires that we compile against DNN 3.0.11 - which means LOTS of new things don't exist in the core reference. Here is how I did the same code as above with reflection:

Private Function ForceAJAXPostBack(ByVal objects As Object(), Optional isModuleSetting as Boolean = False)
Try
Dim asm As System.Reflection.Assembly = System.Reflection.Assembly.GetAssembly(GetType(DotNetNuke.Framework.CDefault))
Dim t As Type = asm.GetType("DotNetNuke.Framework.AJAX")
Dim ctrl As Object
If Not t Is Nothing Then
'THIS TYPE IS SUPPORTED BY OUR FRAMEWORK - DO THE CORRECTION
'If DotNetNuke.Framework.AJAX.IsInstalled Then
' DotNetNuke.Framework.AJAX.RegisterScriptManager()
' DotNetNuke.Framework.AJAX.RegisterPostBackControl(btnMyButton)
'End If
Dim _IsInstalled As Boolean
Dim b As Boolean = (t.InvokeMember("IsInstalled", Reflection.BindingFlags.InvokeMethod, Nothing, Nothing, New Object() {}))
'IF THIS IS A MODULE SETTINGS CONTROL - AJAX IS ALWAYS ENABLED SO FORCE _IsInstalled TO TRUE
If _IsInstalled OrElse isModuleSetting Then
t.InvokeMember("RegisterScriptManager", Reflection.BindingFlags.InvokeMethod, Nothing, Nothing, New Object() {})
Dim obj As Object
For Each obj In objects
t.InvokeMember("RegisterPostBackControl", Reflection.BindingFlags.InvokeMethod, Nothing, Nothing, New Object() {obj})
Next
End If
End If
Catch ex As Exception
'LOG AN EXCEPTION HERE IF YOU MUST
End Try
End Function
RegGFXUser is Offline
New Member
New Member
Posts:10

--
27 Nov 2007 03:21 AM  
WOW!!!

HOLY "CHANGE THE CORE CODE" BATMAN!
I knew something was up!

Thanks for the Reply...

Here is what i know... in the YE'OL DNN 2.x versions you could put a simple input boxes with a submit button(pasted inside the TEXT/HTML as HTML) and submit hidden input info to a DNN Page that had the IFRAMED HTML or ASP page. That DNN Page with the HTML or ASP page IFRAMED inside of the DNN page would recieve the data via the hiddin input from the "POST BACK".

However, in DNN 4.7 you get an error called
"Failed to load viewstate."
I'm just trying to find a way to post hiddin input submitted from a traditional form text box to a HTML or Classic ASP page that rests inside a DNN IFRAME Module.



RegGFXUser is Offline
New Member
New Member
Posts:10

--
27 Nov 2007 05:28 PM  
Thanks...

I knew i wasn't seeing things. Although an odd process i have to use POST-BACK ability alot and 4.7 appears to kill it.

Until a patch is announced, what version of DNN 4 will still permit me to force a full POST-BACK as before the changes?
kevinmschreinerUser is Offline
Advanced Member
Advanced Member
Posts:729

--
27 Nov 2007 09:49 PM  
The last 4.6 was the one you want. *OR* you can disable AJAX in 4.7 - that is handled within the Host Settings. You might want to start off there.
You are not authorized to post a reply.

Active Forums 4.1
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seatle, WA • 410.327.0007 • info@R2Integrated.com

Bookmark & Share Bookmark and Share