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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:53:08+00:00 2026-05-17T20:53:08+00:00

I have a site running with ASP.NET MVC 1 and have encountered a bug

  • 0

I have a site running with ASP.NET MVC 1 and have encountered a bug where a bool in my model is being reset to default because the value is not used in the view.

The code for the Controller:

public ActionResult Edit(Guid id)
{
    Service service = GetService(id);

    if (service == null)
        return View("NotFound");

    return View(service);
}

when the view code had:

<label for="IsActive"> Is Active: </label> 
<%= Html.TextBox("IsActive") %>

it was working fine however once it was deleted the isactive field was always returned as false. I no longer want the isactive to be seen or modified from this view but removing it has caused the value to be lost, i have tried setting the value and not displaying it with

<% Html.TextBox("IsActive"); %>

but that still had it defaulting the value to false

[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Edit(Service service)
{
    //UpdateLogic
}

in the post method, regardless what IsActive had been before, the Service.IsActive is always false

basically i was just wondering how i could get the site to keep the value it was passed without displaying the text box in the view (have tried googled but failed to get the right combination of words for a decent result)

  • 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-17T20:53:08+00:00Added an answer on May 17, 2026 at 8:53 pm

    Can you add it as a Hidden on the page:

    <%= Html.Hidden("IsActive"); %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC 4 site running perfectly well in an Azure WebRole.
Possible Duplicate: Caching in asp.net-mvc i have an asp.net-mvc site and i am running
I have Elmah up and running in my ASP.NET MVC site and I would
I have an asp.net mvc 3 site running locally and everything works fine. I
I have an ASP.NET MVC 3 web site that uses Windows Authentication running under
I have a site built using asp.net mvc running on IIS 7 using integrated
i have an asp.net website http://www.site.com . This web app is also running on
I have an asp.net (mvc) web site. As the part of the functions I
I have an ASP.NET MVC web application running in IIS as a subweb; let's
I have an ASP.NET MVC 3 site that I'm trying to enable client-side validation

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.