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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:05:06+00:00 2026-05-13T21:05:06+00:00

Head scratching :( I am trying to bind one value to label and back

  • 0

Head scratching 🙁
I am trying to bind one value to label and back to model from label , but not working
I can see the value in View but after post action controller method Model is not having that value.

Please suggest ! Can’t Label values posted to the server like classic asp.net ?

public class MyModel
    {
        public MyModel()
        { 

        }

        public string FirstName {set; get;}

        public string Desciptopn { set; get; }

        public string EventDate2 { set; get; }

        public bool Failed { set; get; }



    }




<%
              EventDate2.Text = Model.EventDate2;
        %>
            <asp:Label ID="EventDate2" runat="server" Text="Label"></asp:Label>
  • 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-13T21:05:07+00:00Added an answer on May 13, 2026 at 9:05 pm

    Don’t use server side controls with MVC. These values are not persisted (no viewstate) back to the server. If you need the value passed back as part of the model, you should put it in an HTML input, perhaps hidden, in addition to including the text on the page.

    <% using(Html.BeginForm()) { %>
      <%= Html.Hidden( "EventDate2" ) %>
      <%= Html.Encode( Model.EventDate2 ) %>
    <% } %>
    

    Anything you want sent back needs to be either part of a URL (for a GET request) or a form input. These will get translated to your action method parameters/model.

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

Sidebar

Related Questions

This one has me scratching my head. I'm running Subversion 1.3.1 (r19032) on Ubuntu.
I've been scratching my head on this one for a while now and am
This may seem like a somewhat contrived example, but I'm left scratching my head.
I am scratching my head trying to do this and it's eating me up.
I have been scratching my head trying to find any resources on substringing an
I've been scratching my head trying to figure out how to use Regex.Replace to
I was kind of scratching my head at this a week ago, and now
After two hours of head scratching and googling - i'm stuck! As per the
There's one specific feature that I wish was in the .NET framework, but isn't.
I'm reading through head first design patterns at the moment and while the book

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.