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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPI"Supports Partial Rendering" causes response.write not to work?"Supports Partial Rendering" causes response.write not to work?
Previous
 
Next
New Post
4/16/2010 2:31 PM
 

Why would marking a module as "Supports Partial Rendering" cause the following code to not work?  Also, is there a better method to execute is code?

(This code posts to a credit card gateway for PCI compliance.)

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSubmit.Click

Dim FormHTML As StringBuilder = New StringBuilder
Dim HTML As StringBuilder = New StringBuilder

HTML.Append("<script type=""text/javascript"">")
HTML.Append("var newWin = window.open("""", ""NewWin"", ""width=675,height=600,scrollbars=1,resizable=1"");")
HTML.Append(ControlChars.CrLf)
HTML.Append("newWin.document.open();")
HTML.Append(ControlChars.CrLf)
HTML.Append("newWin.document.write('")

FormHTML.Append("<html><head><title>Test</title></head><body>")
FormHTML.Append("<form name=""AutoForm"" method=""post"" action=""https://test1.xxxxx.com/xxxxx/main.aspx"">")
FormHTML.Append("<input type=""hidden"" name=""TransactionAmount"" value=""1.00"" \/>")
FormHTML.Append("<input type=""hidden"" name=""ECOMRequestID"" value=""{xxxxx-xxx-xxxx-xxxx-xxxxxxxxxxxx}"" \/>")
FormHTML.Append("<input type=""hidden"" name=""PurchaseIdentifier1"" value=""ORDER-0006"" \/>")
FormHTML.Append("<input type=""hidden"" name=""PurchaseIdentifier2"" value=""Customer #6"" \/>")

FormHTML.Append("<\/form>")
FormHTML.Append("<SCRIPT type=""text/javascript"">document.AutoForm.submit();<\/SCRIPT>")
FormHTML.Append("<\/body><\/html>")

HTML.Append(FormHTML.ToString)
HTML.Append("');")
HTML.Append(ControlChars.CrLf)
HTML.Append("newWin.document.close();")
HTML.Append(ControlChars.CrLf)
HTML.Append("</SCRIPT>")

Response.Write(HTML.ToString)

End Sub

 
New Post
4/16/2010 4:08 PM
 

Regardless of partial rendering, I am not sure I understand this code.  ASP.NET has a single form rendered per page as a limitation.  You seem to want a click handler of a button (within a form) to on postback to itself write out a completly different html, body, and form tag...  This seems a bit off to me.

Throwing partial rendering into the mix now says that an AJAX call will be made and code that ASP.NET does not know about (due to using response.write) will be parsed and somehow inserted back into the location on the page where it would have been for a normal postback. 

Seems like the best option for you is to render your script to the client within your module.  Add a click handler in the javascript, that executes the script.


 
New Post
4/16/2010 6:15 PM
 

Jon, thanks for your reply and advice.

I'm needing to do a "post" to the gateway and pass some hidden fields.  I'm really not sure how to do this.

Can you recommend any examples?

Thanks for your help and all your work on the DNN project.

 
New Post
4/16/2010 7:39 PM
 

That sounds like an over-complicated method.  If you need to force a POST to another url, you can simply use the WebClient class to do this.

http://msdn.microsoft.com/en-us/library/system.net.webclient%28VS.80%29.aspx

And if you do for some reason need to stick with your JS method, you can fix the partial rendering problem by checking the http method:

if (Request.HttpMethod == "GET")

// now you can safely use response.write()

Oscar

 


You know your website is cool, so why not let your users help you by spreading the word on social networking sites - get the DotNetNuke Social Bookmarks Module with 57 different ways to add social bookmarks to your site ... or download the FREE demo right now
 
New Post
4/20/2010 2:20 PM
 

I'm really not having much luck getting this to work.

The gateway requires that I "POST" the form to them passing the "HIDDEN" fields.  I've done a lot of searching and trying things out, but just can't seem to get it to work.  It can't be that hard to do.

Can some one help me ?

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPI"Supports Partial Rendering" causes response.write not to work?"Supports Partial Rendering" causes response.write not to work?


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