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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:04:57+00:00 2026-05-31T13:04:57+00:00

In my application (written in c#) I have a textbox and a submit button.

  • 0

In my application (written in c#) I have a textbox and a submit button.
If the user clicks “submit” without entering any value, I want him to stay at the same page and display a message saying “Please insert value”
I thought to put a label, and then just edit its value and/or visibility.

The structure of my application is as following:
Controller A
inside View, under A, I have B.aspx
and inside B.aspx I call a partial C.ascx
The submit form with my label are inside C.ascx

How can I change the lable value and/or visibility?

  • 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-31T13:04:58+00:00Added an answer on May 31, 2026 at 1:04 pm

    You should use the Data Validation Attributes for this.

    Something like this:

    [Required]
    String textBoxValue{get;set;}
    

    This will create a custom javascript/jquery file that will perform the appropriate validation for you.

    You can even change the default error message for Required.

     [Required(ErrorMessage = "The textbox value is required because I said so :)")]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a application which runs in the background. I want to write
I have written an application in which I want to convert a .jpg image
i have written a small form application, which contains textbox only. I have enabled
I have written some application in c# .net and I want it to be
I have Application written with GWT 1.7. I have one page where I upload
I have application written in Visual Studio 2008 which I deploy with ClickOnce to
Question I have an application written in Java. It is designed to run on
Background I have an application written in native C++ over the course of several
I have written an Application Desktop Toolbar (a.k.a AppBar), it works great except for
Background: I have an application written in native C++ which uses the wxWidgets toolkit's

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.