0

I use Umbraco 4.7.

I have a page of news - NewsPage with 3 functionalities:

a) display the list of news (3 max on first page, module NewsList.cshtml),
b) "display detail of a news" in a popup (template Ajax\Popup.cshtml), and
c) "display more news" (displays the next 3 news on the list).

As I don't know how to use 2 Ajax templates for the same page (one for popup and one for more news),
I would like to use the same module (NewsList) to display "next 3 news".

How, in the NewsList.cshtml, to make difference between a normal "get" and an "Ajax get"?

serhio
  • 28,010
  • 62
  • 221
  • 374

1 Answers1

0

In NewsList.cshtml, add this:

@{
var isAjax = Request.IsAjaxRequest(); 
}

Then you can use the "isAjax" variable in your Razor code to change the output.

Emanuel
  • 616
  • 5
  • 14