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

  • SEARCH
  • Home
  • 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 8603943
In Process

The Archive Base Latest Questions

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

My Controller Action is: public ActionResult PVInPage() { return View(); } public ActionResult ViewPage2()

  • 0

My Controller Action is:

        public ActionResult PVInPage()
        {
            return View();
        }

        public ActionResult ViewPage2()
        {
            return PartialView();
        }

My Main View:

@using (Html.BeginForm("ViewPage2", "PartialViewInPage"))
{    
    <input type="submit" value="Call Page Two" />  
}

<div id="DisplayPartilView">

        @*display partial view *@

</div>

My Partial view Is :

  @{
        ViewBag.Title = "View Page 2";
    }

    <div style="width:500px; height:200px; background-color:Gray" >


     <h1> This is my Partial view </h1>

    </div>

Now I want to do : when i click submit button in my main view then my partial view arise in

My main view inner div with id=”DisplayPartilView”.
Thanks for response

  • 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-12T02:26:44+00:00Added an answer on June 12, 2026 at 2:26 am

    If you want to load data/html into a page without navigating to a different page you need to use Ajax.

    ASP.Net MVC provides a set of helpers to work with Ajax (they are all use jQuery.Ajax under the hood so you can always drop back to one level and write your ajax calls by hand).

    But in your case the Ajax.BeginForm provides everything what you need:

    So change your main view to:

    @using (Ajax.BeginForm("ViewPage2", "PartialViewInPage", 
            new AjaxOptions() { UpdateTargetId = "DisplayPartilView" }))
    {    
        <input type="submit" value="Call Page Two" />  
    }
    
    <div id="DisplayPartilView">
    
            @*display partial view *@
    
    </div>
    

    And to make it work you need to reference the following script in your main view or in your layout file after jQuery:

    <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

Controller action: public ActionResult Index() { ViewData[sample] = DateTime.Now.ToLongTimeString(); Thread.Sleep(3000); return View(); } View
i am creating a partialview with a controller action like: public ActionResult GetPostsByUser(string userName)
This is what my controller action looks like [HttpPost] [OutputCache(Location = OutputCacheLocation.None)] public ActionResult
I have an overloaded action in my Controller: public ActionResult AssignList(int id) { ...
Controller action: public ActionResult Index() { probaEntities proba = new probaEntities(); probaEntities proba1 =
Take the following controller action public ActionResult NextBySURNAME(int id, string data) { //code to
I have the following controller Action: public ActionResult Details(int id) { Seguimiento seguimiento =
I have a form in my asp.net mvc view as follow: <%using (Html.BeginForm(SearchBorrowed, Admin,
I have the following controller action: public ActionResult Edit(int id) { var news =
Inside my controller's action I have the following code: public ActionResult GridAction(string id) {

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.