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 9039551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:45:25+00:00 2026-06-16T09:45:25+00:00

i wish to change the inner html of a view on button click but

  • 0

i wish to change the inner html of a view on button click but maintain the view. I know how to change the html content of a div in javascript, but how can I have the action of the button not return a different view?

My buton looks like

<input type="submit" value="submit" onchange="myfunc()"/>

where myfunc() is the function in Javascript changing the div content.

  • 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-16T09:45:26+00:00Added an answer on June 16, 2026 at 9:45 am

    Assuming you want a link to render content using ajax (and hopefully using razor) you can do something like the following:

    First, setup the action to render the content partially. this can be done a few ways, but I’ll keep with the logic in the action (and make it callable directly or by ajax):

    [HttpPost]
    public ActionResult Save(SomeModel model)
    {
      /* build view */
      return Request.IsAjaxRequest() ? PartialView(model) : Wiew(model);
    }
    

    Next, setup a container in your page where the content will be populated along with the form you’re looking to submit. If you want the form to disappear on a save, wrap it in the container. Otherwise, keep the container separated. In the below example, the from will submit and on success it’ll come back, otherwise the new content will appear in its place:

    <div id="ajaxContentPlaceholder">
      @using (Ajax.BeginForm("Save", new AjaxOptions { UpdateTargetId = "ajaxContentPlaceholder" })) {
          <!-- form elements -->
          <input type="submit" value="save" />
      }
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a combobox in my winform, and I wish change the button that
I have a System.Type stored in a variable. I wish to Change an object's
I have an existing system that I do not wish to change where I
I wish to change the value of html hidden label to a value of
I have a model which has a ForeignKey field, and I wish to change
The user can change language on my webpage and I wish to change the
I have an outer div, called #wrap, and two inner divs: #container and #footer.
I wish to change some visual properties of nodes and connections. How better can
As the title explains, I wish to change the color of a row when
I wish HTML could do something semantically equivalent to this; <dl class=main-list> <definitionitem> <dt>Some

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.