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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:27:26+00:00 2026-05-22T11:27:26+00:00

I am trying to replace <div> content after a form submit. Here is the

  • 0

I am trying to replace <div> content after a form submit. Here is the code (it is a partial view):

    <% using (Ajax.BeginForm("Authenticate", "User", new AjaxOptions { HttpMethod = "post", UpdateTargetId = "authPanel", InsertionMode = InsertionMode.Replace}))
{%>
    <label>Username</label><%= Html.ValidatedTextBoxFor(username => Model.UserAuthienficateDto.Username, false) %>
    <label>Password</label><%= Html.ValidatedTextBoxFor(password => Model.UserAuthienficateDto.Password, false) %>
    <input name="Input" type="submit" class="button" value="Authenticate" />
<%}%>
<div id="authPanel">
<ul>
    <% if (HttpContext.Current.User.Identity.IsAuthenticated)
    {%>
        <li class="nonregister">Logged in as <%=HttpContext.Current.User.Identity.Name%></li>
        <li class="register"><%= Html.ActionLink("Logout", "Logout", "User")%></li>
    <%
        }%>
    <% else
    {%>
        <li class="nonregister">Not a member &nbsp;?</li>
        <li id="userRegisterDialogOpener" class="register">Sign up now!</li>
    <%}%>
</ul>
</div>

The problem is that after form submit I get whole partial view re-rendered. Also all the results are being rendered above the old ones (they have some offset though). Why InsertionMode.Replace is not working properly? Mant thanks in advance for your help.

  • 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-05-22T11:27:26+00:00Added an answer on May 22, 2026 at 11:27 am

    I have solved the problem by separating form and authPanel to different partial views.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using a simple piece of code $(container).load(url, function(){ callback();}) to replace the content
I am trying to replace some div text automatically using the .html command in
i am trying to replace the content of a div with the content of
I am trying to replace content inside particular div tags (id=dd-header) with a comment.
I'm trying to replace a div with created elements, going from: <div id='links'></div> to
I'm trying to replace certain text inside the div info when an image (which
I'm trying to use GreaseMonkey to replace the background image of a DIV on
When trying to replace the content of an XML file in C#.NET with a
I'm trying to do a little javascript trick to fade out a div, replace
I'm trying to implement jQuery tabs to replace AJAX tab container. I've followed the

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.