Positive Validation?

Posted on 2005-02-27
Medium Priority
Last Modified: 2012-05-05
I'm using the validation controls in .NET to make sure my data is entered right.  So far, so good.  However, I'm wondering if it's possible to tell the user that a record has been updated using the validation controls.  In other words, if the user enters everything right for a new salesman, for example, could I use the validation controls to say, "Salesman Entered", or at least write a message like that to the summary control?
Question by:Remulac
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
  • 2

Assisted Solution

gregasm earned 375 total points
ID: 13417414
I don't think you should use the validation control to notify the user.

The reason is because when the error text property is set, then the control will fail validation.

May I suggest other ways to notify the user:  Either the StatusBar, or a modal form that becomes visible and displays the message to the user, and then goes away. Another way is to use something like MSN Messenger. Have you seen those notification forms pop up in the bottom right corner of the screen when someone logs on and off? This is the same concept as what I am suggesting above.

You might also want to allocate some space on yoru form for a status textbox and post the messages to that. How about a listbox, and when new messages are needed, then add an item to the listbox. This way you can keep a history of the messages...

Obcviously, I don't know your requirements and I am just throwing out suggesting that may or may not apply. The bottom line is, The validation control is not the right control for your needs.

Let me know if you need more pointers or usability tips.

LVL 26

Accepted Solution

Rejojohny earned 375 total points
ID: 13417554
as gregasm mentined, u cannot use the validation control to show the message ..
>>could I use the validation controls to say, "Salesman Entered",
This could be done using a label within ur form and making in invisible at the start.. when the record is updated, use (in ur code-behind)
UrLabel.text = "Salesman Entered"
UrLabel.visible = true

>>or at least write a message like that to the summary control?
for this u could render a script after the data is updated
write this code after the data is successfully updated - in ur code-behind

Dim lstrScript as string
lstrScript += lstrscript & "<script language=javascript>" & vbcrlf
lstrScript += lstrscript & "alert('Salesman Entered');" & vbcrlf
lstrScript += lstrscript & "</script>
RegisterClientScriptBlock("MyMessage", lstrScript)


Expert Comment

ID: 13418111
You could always raise a message box, like so:

if (successfullyUpdated == true)
    Page.RegisterClientSideScript("success", "<script>alert('Successfully updated employee');</script>");
LVL 26

Expert Comment

ID: 13418132
i do think there is any member called "RegisterClientSideScript" to the page class .. if u meant "RegisterClientScriptBlock" then how is it different from what i suggested? ...

Expert Comment

ID: 13418140
Very true, sorry didn't read your response before posting mine!

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 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