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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:40:46+00:00 2026-05-14T04:40:46+00:00

I have a table [Users] with the following columns: INT SmallDateTime Bit Bit [UserId],

  • 0

I have a table [Users] with the following columns:
INT SmallDateTime Bit Bit
[UserId], [BirthDate], [Gender], [Active]

Gender and Active are Bit that hold either 0 or 1.

I am displaying this data in a table on my View.

  1. For the Gender I want to display
    ‘Male’ or ‘Female’, how and where do
    I manipulate the 1’s and 0’s? Is it done in the repository where I fetch the data or in the View?

  2. For the Active column I want to show
    a checkBox that will AutoPostBack on selection change
    and update the Active filed in the
    Database. How is this done without
    Ajax or jQuery?

  • 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-14T04:40:47+00:00Added an answer on May 14, 2026 at 4:40 am

    For Question #1:

    Use a DisplayTemplate. In View/Shared create a folder named DisplayTemplates. Then Add a partial View to this folder named Gender.ascx. Make sure it is not strongly typed.

    the markup in this file will look like this:

    <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Boolean>" %>
    <span><%= Model ? "Male" : "Female" %></span>
    

    Then in your Model you decorate the Gender property with a UIHint thusly:

    [UIHint("Gender")]
    public boolean Gender { get; set; }
    

    In your View you make it use this template by using DisplayFor

    <%= Html.DisplayFor(model => model.Gender) %>
    

    If you cannot use the UIHint you can explicity name your template in DisplayFor

    <%= Html.DisplayFor(model => model.Gender, "Gender") %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using SQL-Server 2005 Standard. I have Users table with following columns: userID(int), userImage(varchar),
I have a table of users containing the following columns: | User_ID (int) |
I have the following XML document: <database name=pressPlay> <table name=users> <column name=userID type=INT constraints=tableID_c
I have a SQL table (Trade Mapping) with the following columns: BTF_TRADE_MAPPING_KEY int BTF_SYSTEM_CODE
I have a MySQL table with the following columns: id(int), date (timestamp), starttime(varchar), endtime(varchar),
I have the following table for storing user data: e.g. TABLE: users COLUMNS: ...
I have the following database structure (which can't be changed): Users - UserID (int)
i have users_details table with the following columns martial_status | religion | education i
I have 3 tables with the following columns : * users : user_id *
I have a table called LOGS with the following columns: id - user -

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.