Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8630163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:59:43+00:00 2026-06-12T08:59:43+00:00

I want to click the button on the main view and populate the partial

  • 0

I want to click the button on the “main view” and populate the partial view in its own . Updated

I have a main view:

 @{
using (Ajax.BeginForm("PastClaims", "Claim", FormMethod.Post, new AjaxOptions { UpdateTargetId = "update_panel", InsertionMode = InsertionMode.Replace }, new { @class = "form-horizontal" }))
{
    <legend>Submit a Claim</legend>
    @Html.EditorForModel()
    <div class="controls">
        <input id="btnCheckForClaims" type="submit" class="btn btn-primary" value="Submit Claim" />
    </div>


    }

I need to click the submit button then display this other view:
If I do below then on the page on the initial load it displays the div

 <div id="update_panel">@Html.Partial("PastClaims")</div>

If I leave the div blank then I get a new partial view.

  <div id="update_panel"></div>

if I leave them null like darrin suggested:

using (Ajax.BeginForm("PastClaims", "Claim", FormMethod.Post, new AjaxOptions { UpdateTargetId = "update_panel", InsertionMode = InsertionMode.Replace }, new { @class = "form-horizontal" }))

I am redirected to the same page (what I want) but the additional partial view is not displayed.

Thanks to Darrin below to get me this far.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:59:44+00:00Added an answer on June 12, 2026 at 8:59 am

    You could use an Ajax.BeginForm in this case:

    @using (Ajax.BeginForm(null, null, new AjaxOptions { UpdateTargetId = "update_panel", InsertionMode = InsertionMode.Replace }, new { @class = "form-horizontal"}))
    {
        @Html.EditorForModel()
        <div class="controls">
            <input id="btnOpenPartialView" type="submit" class="btn btn-primary" value="OpenPartialView" />
        </div>
    }
    
    <div id="update_panel">
        @Html.Partial("PartialView")
    </div>
    

    and then the corresponding controller action will return the partial view:

    [HttpPost]
    public ActionResult SomeAction() 
    {
        // some processing ...
        return PartialView("PartialView");
    }
    

    For Ajax.* helpers to work don’t forget to include the jquery.unobtrusive-ajax.js script:

    <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to implement a click listener for a button on my main view.
I have an application page. I want to click a button to pop out
I have a button: <button>Click</button> I want click it and open a new window
I have two tables on a webform. On a button click I want to
When click a button,I want to popup a view form bottom,like this! Any help
I want to be able to click the button and have it copy this:
i have a text held in my main view and a button next to
I have two button and want to change layout content on click button on
i have my main page and also two partial views. One partial view is
Ha ii.I have added a subview by using interface of the main view,and i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.