<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/partial-page-updates-with-asp-net-mvc-and-jquery-and-action-filters--tx2jmdp00" -->

---
title: Partial page updates with ASP.NET MVC and jQuery (and...
description: A step-by-step walkthrough shows how to add partial page updates to an ASP.NET MVC application using jQuery Ajax calls, replicating classic ASP.NET's...
canonical: https://daily.dev/posts/partial-page-updates-with-asp-net-mvc-and-jquery-and-action-filters--tx2jmdp00
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Partial page updates with ASP.NET MVC and jQuery (and action filters) | daily.dev
og:description: A step-by-step walkthrough shows how to add partial page updates to an ASP.NET MVC application using jQuery Ajax calls, replicating classic ASP.NET's...
og:url: https://daily.dev/posts/partial-page-updates-with-asp-net-mvc-and-jquery-and-action-filters--tx2jmdp00
og:image: https://api.daily.dev/og/posts/tX2jMDP00.png
og:image:alt: Partial page updates with ASP.NET MVC and jQuery (and action filters)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Partial page updates with ASP.NET MVC and jQuery (and action filters)

**[Maarten Balliauw](https://daily.dev/sources/maartenballiauw)** · 3 min read · 0 upvotes · 0 comments

## Summary

A step-by-step walkthrough shows how to add partial page updates to an ASP.NET MVC application using jQuery Ajax calls, replicating classic ASP.NET's UpdatePanel behavior. The approach involves creating an empty master page to avoid duplicate layout rendering, and building a custom jQueryPartial action filter that detects the X-Requested-With header to switch the response's master page when a request is Ajax-driven. Full code samples for the jQuery click handler, the action filter class, and the decorated controller action are included, along with a downloadable sample project.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.maartenballiauw.be/posts/2008-11-25-partial-page-updates-with-aspnet-mvc-and-jquery-and-action-filters>

## Questions this post answers

### How do I detect an Ajax request from jQuery in an ASP.NET MVC action filter?

Check the X-Requested-With HTTP header in the OnResultExecuting method of a custom ActionFilterAttribute; jQuery automatically sets this header to XMLHttpRequest on asynchronous requests. When present, the filter can change the ViewResult's MasterName property to swap out the layout, avoiding duplicated page chrome when loading content via Ajax.

_Developers wiring up ajax-driven partial views in ASP.NET MVC compare similar patterns on daily.dev._

### How do I avoid a double-rendered layout when loading an ASP.NET MVC view via jQuery load()?

Create an empty master page containing only the same content placeholder regions as the original, with no other markup, and apply it to the Ajax-targeted action's ViewResult. This way the partial view renders without the full site layout, so appending it into an existing page element does not duplicate headers, footers, or navigation.

_Anyone untangling master page and partial view layout issues in MVC can find similar fixes on daily.dev._

## Similar posts on daily.dev

- [Understanding Partial Views in ASP.NET MVC](https://daily.dev/posts/understanding-partial-views-in-asp-net-mvc-salagpukh) · C\# Corner · 1 upvotes · 0 comments
- [Reveal Content with the ASP.NET MVC Responsive Panel](https://daily.dev/posts/reveal-content-with-the-asp-net-mvc-responsive-panel-lzzpnnhbf) · Telerik · 0 upvotes · 0 comments
- [Kendo Grid in jQuery with All Important Properties in ASP.NET MVC](https://daily.dev/posts/kendo-grid-in-jquery-with-all-important-properties-in-asp-net-mvc-lnv3dmdby) · C\# Corner · 0 upvotes · 0 comments
- [Select2 Dropdown in ASP.NET MVC](https://daily.dev/posts/select2-dropdown-in-asp-net-mvc-hkadyit2r) · C\# Corner · 1 upvotes · 0 comments

---

Tags: [#c#](https://daily.dev/tags/c#), [#jquery](https://daily.dev/tags/jquery)

[View this post on daily.dev](https://daily.dev/posts/partial-page-updates-with-asp-net-mvc-and-jquery-and-action-filters--tx2jmdp00)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Partial page updates with ASP.NET MVC and jQuery (and action filters)","url":"https://daily.dev/posts/partial-page-updates-with-asp-net-mvc-and-jquery-and-action-filters--tx2jmdp00","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/partial-page-updates-with-asp-net-mvc-and-jquery-and-action-filters--tx2jmdp00"},"datePublished":"2026-10-04T13:06:11.111Z","dateModified":"2026-10-04T13:13:38.422Z","description":"A step-by-step walkthrough shows how to add partial page updates to an ASP.NET MVC application using jQuery Ajax calls, replicating classic ASP.NET's...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cee1fa92a68b2719e92d0a158b44e3d4?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cee1fa92a68b2719e92d0a158b44e3d4?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Maarten Balliauw","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Maarten Balliauw","logo":"https://media.daily.dev/image/upload/s--rOTg3VYO--/f_auto,q_auto/v1791119043/logos/maartenballiauw?_a=BAMAMicg0","url":"https://daily.dev/sources/maartenballiauw"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/partial-page-updates-with-asp-net-mvc-and-jquery-and-action-filters--tx2jmdp00","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c#,jquery","timeRequired":"PT3M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Maarten Balliauw","item":"https://daily.dev/sources/maartenballiauw"},{"@type":"ListItem","position":3,"name":"Partial page updates with ASP.NET MVC and jQuery (and action filters)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/partial-page-updates-with-asp-net-mvc-and-jquery-and-action-filters--tx2jmdp00#faq","mainEntity":[{"@type":"Question","name":"How do I detect an Ajax request from jQuery in an ASP.NET MVC action filter?","acceptedAnswer":{"@type":"Answer","text":"Check the X-Requested-With HTTP header in the OnResultExecuting method of a custom ActionFilterAttribute; jQuery automatically sets this header to XMLHttpRequest on asynchronous requests. When present, the filter can change the ViewResult's MasterName property to swap out the layout, avoiding duplicated page chrome when loading content via Ajax. Developers wiring up ajax-driven partial views in ASP.NET MVC compare similar patterns on daily.dev."}},{"@type":"Question","name":"How do I avoid a double-rendered layout when loading an ASP.NET MVC view via jQuery load()?","acceptedAnswer":{"@type":"Answer","text":"Create an empty master page containing only the same content placeholder regions as the original, with no other markup, and apply it to the Ajax-targeted action's ViewResult. This way the partial view renders without the full site layout, so appending it into an existing page element does not duplicate headers, footers, or navigation. Anyone untangling master page and partial view layout issues in MVC can find similar fixes on daily.dev."}}]}
```

