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 Community Exchange, where community members ask and answer questions about DNN. To get started, just start typing your question below and either select one of the suggested questions or ask a new question of your own.

Execute an action by calling an AJAX post

Return to previous page

  • 3/16/2016
  • 6443 Views

Question:

Yvo Linssen 9 years ago

Hi,

Another problem occured in my DNN MVC development journey. I am wondering whether this is a bug/missing feature of I've made a mistake.
I will try to explain the problem and my attempts to resolve/bypass it.

What do I want to achieve?
I want to execute an action in my controller by calling an AJAX post. So far it works.
However, when I try to return some variables to my View, it doesn't only return the variables. It adds an whole HTML-source to the response.

My controller
My method returns an ActionResult (I tried JsonResult and something different: HttpResponseMessage).
The program itself is working and does return the json-message.

My view
The View below isn't my final View, but's meant to test.

Does anybody know why it is returning an whole HTML-source instead of just the specified variables? Is this a bug, or something I am able to fix? Thank you very much for your time.

Execute an action by calling an AJAX post

Yvo Linssen
Yvo Linssen 9 years ago
Add an Answer

Answers

Sign In to Participate
Or register to become a member