?
Solved

C# Code Behind Label Validation Event

Posted on 2014-09-26
2
Medium Priority
?
293 Views
Last Modified: 2014-10-02
I have a form that has a TextBox and DropDownList .    I need to validate that something is entered into the TextBox when "CONMX" is selected in the dropdown.    The TextBox ID is "Conmx" and the DropDown ID is CondBY,    

When "CONMX" is selected in the dropdown, Label1 should display on the Markup Page form if the user attempts to submit prior to entering something into the text box.
Back.docx
0
Comment
Question by:BOEING39
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 15

Accepted Solution

by:
Ess Kay earned 2000 total points
ID: 40352485
add to ONCLICK for submit button
    inside code:

      if (CONMX.text.length = 0) then {

       label1.text = "text not entered"
     }else {
      ...submit...
     }
0
 

Author Closing Comment

by:BOEING39
ID: 40358154
That worked - thx
0

Featured Post

WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question