0

I am working with a Commerce Manager and I need to be able to embed their payment system with my MVC 4 project.

Sample code below.

<iframe id="sFrame" width="200" height="300" src="<%=request.getContextPath()%>https:/comManager.com/pay_school/rce_manager/payer.do?order=s_cart&contentEmbedded=true" frameborder="yes" scrolling="no">
</iframe>

I tried this but no luck. --- UPDATED CODE BELOW ----

<iframe id="sFrame" width="200" height="300" src="@System.Web.HttpContext.Current.Request.ApplicationPath https:/comManager.com/pay_school/rce_manager/payer.do?order=s_cart&contentEmbedded=true" frameborder="yes" scrolling="no">
    </iframe>
ceci
  • 429
  • 1
  • 7
  • 22

1 Answers1

0

The equivalent to java getContextPath() in .net is System.Web.HttpContext.Current.Request.ApplicationPath, not UrlReferrer.Host!

And according to <%$, <%@, <%=, <%# ... what's the deal? you should check your shorttag @{} or is this a MVC 4 specific thing I've never seen before?

Also I don't know where the sample code is from, but if the comManager.com/pay_school URL should be a (redirect)parameter, then you might URLencode it!

Community
  • 1
  • 1
childno͡.de
  • 4,679
  • 4
  • 31
  • 57
  • I updated the code above to reflex your suggestion. I now get this error **"A potentially dangerous Request.Path value was detected from the client (:)"** See screen shot [link](https://www.dropbox.com/s/qi1qj3zglfwlkd1/dangerouspath.png?dl=0) . BTW adding the @ sign at the begging its an MVC thing which is the same as <%= in APS.NET. Thanks. – ceci Dec 12 '14 at 15:50