Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0DNN page is blank after posting to another web pageDNN page is blank after posting to another web page
Previous
 
Next
New Post
8/16/2006 9:43 AM
 

I have written a custom module for single sign-on access to other company websites, such as our Outlook Web Access page.  The code dynamically creates the html form with the appropriate username and password values and submits it to the other site using the Response object, opening the page in a new window.    When I use this code from an aspx page it works perfectly. 

When I use the same code in a custom module, it opens the other site in a new window and logs the user in, but it leaves the dnn page completely blank.  The user then has to click on the Back button in the browser in order to make the dnn page reappear.

Does anybody have any idea why this is happening, or better yet, know how I can fix it? 

Thanks!

 
New Post
8/16/2006 10:21 AM
 
DotNetNuke uses a form.  Trying to insert your form within DotNetNuke's form is probably the root of your problem.  You can try a simple solution to this by using an IFrame to display your original .aspx page from your custom module or try Text/HTML module.

    - Doug Vogel     

 
New Post
8/16/2006 1:53 PM
 

Doug,

Thanks for your reply!  I am not sure I entirely understand your post though.  When you say to try to use an IFrame to display my original aspx page, do you actually mean my usercontrol?  Or do you mean that I should add an aspx page to my module inside an IFrame?  My code definitely needs to run inside the module, because I have to retrieve the username and password from DotNetNuke.

 At the moment, there is no aspx page involved.  I did test it with an apx page though, to verify that it was an issue with DotNetNuke, not my code in general.  The code in my module posts an html form to other applications - one is an asp page and the other is a php page. 

Thanks,

Sheila

 

 
New Post
8/16/2006 4:31 PM
 
sheilagraven wrote
My code definitely needs to run inside the module, because I have to retrieve the username and password from DotNetNuke.  

Sorry, I didn't quite understand how you had things setup. 

Right now I'm working on a project that opens a new window.  View it in action here by clicking on any Title.  This transfers a ton of info from DotNetNuke Module to this new window. 

Is this similar to what you want to do?  I can certainly show you how I did that.

I (or anyone else here) might be more help if you post some code to look over.


    - Doug Vogel     

 
New Post
8/17/2006 9:00 AM
 

My bad, I should have included a more complete explanation and my code in the original post!  I have a class that I use to generate the string for an HTML form, including hidden data fields and submit it to another URL.  I use that class to create a form to submit the username and password values to pass to the login form of another app.  All of these apps use Active Directory for authentication, but they have to work when the user is on a public computer, so we can't rely on Windows authentication.

I might be able to use your something like your example to create an aspx page that uses this code, if I can safely pass the username and password to this page (ie not in the query string).  Then I could have a link in my portal that opens this page.  Are you actually transferring the data to another aspx page?  If so, could you show me how you do that?

Thanks in advance for you help.

Sheila

My code:

Public Class CrossPost

'Collection to hold the field names and their values

Private fieldNames As System.Collections.Specialized.NameValueCollection = New System.Collections.Specialized.NameValueCollection

'Add a new field name/value pair to post the other form

Public Sub AddField(ByVal name As String, ByVal value As String)

fieldNames.Add(name, value)

End Sub

''' <summary>

''' Posts the data to the url with hidden data fields

''' </summary>

''' <remarks></remarks>

Public Sub PostDataToForm(ByVal Url As String, ByVal FormName As String, ByVal OpenLinkInNewWindow As Boolean)

Try

If OpenLinkInNewWindow Then Url = Url & """ target='_blank'"

System.Web.HttpContext.Current.Response.Clear()

System.Web.HttpContext.Current.Response.Write("<html><head>")

System.Web.HttpContext.Current.Response.Write(String.Format( _

"</head><body onload=""document.{0}.submit();history.back"">", FormName))

System.Web.HttpContext.Current.Response.Write(String.Format( _

"<form name=""{0}"" method=""{1}"" action=""{2}"" >", FormName, "POST", Url))

'Add the fields/values to the response

For Each value As String In fieldNames.Keys

System.Web.HttpContext.Current.Response.Write( _

String.Format("<input name=""{0}"" type=""hidden"" value=""{1}"">", _

value, fieldNames(value)))

Next

System.Web.HttpContext.Current.Response.Write("</form>")

System.Web.HttpContext.Current.Response.Write("</body></html>")

System.Web.HttpContext.Current.Response.End()

Catch xcp As System.Threading.ThreadAbortException

'Swallow this exception. Response.End always causes this, but it

' doesn't effect anything.

Catch ex As Exception

Throw

End Try

End Sub

 

End Class

Protected Sub imgOWA_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgOWA.Click

Dim postToOWA As New CrossPost()

postToOWA.AddField("username", Me.UserInfo.Username)

postToOWA.AddField("password", Me.UserInfo.Membership.Password)

postToOWA.AddField("destination", "https://YOUR_SERVER_HERE/exchange/")

postToOWA.AddField("flags", "0")

postToOWA.PostDataToForm(Url:="https://YOUR_SERVER_HERE/exchweb/bin/auth/owaauth.dll", _

FormName:="logonForm", OpenLinkInNewWindow:=True)

End Sub

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0DNN page is blank after posting to another web pageDNN page is blank after posting to another web page


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out