Wednesday, March 30, 2011

Apply sound Effects for validations in aspnet application

Hi friends ,we already know how to set the server side validations for our controls in aspnet applications but this time we will try differently that means In this tutorial i would like to explain how to set sound validations for our Asnet controls when an error occurs.
so lets start...

First Open the visual studio 2008

Next,select one web application


Next,Drag and drop two textboxes and one button from ToolBox

Next,change the properties for textboxes

Now apply the validations for that textbox controls depending up on your requirement

Example apply the Requiredfield Validator for UserName Textbox and at the same apply the sound effect also.

Following is the code for that

<asp:TextBox ID="txt_UserName" runat="server" ></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"
 Runat="server" Text="<bgsound src='C:\Windows\Media\Beep.wav'>"
 ControlToValidate="txt_UserName" EnableClientScript="False">
</asp:RequiredFieldValidator>


Thats it..

when a user forgets to enter the data in the username field then automatically the necessary sound effect will be fired which was passed in the RequiredField Validator

Depending up on our requirement we need to change the sound effect for validations.that is,apply one sound effect required Field and apply another different soundeffect for Range Validator effect..thats it..

Note:The size of the sound effect file must be max 5 kb .

so lets try my friend...
developercode
About the Author
Sayyad is a Software Engineer, Blogger and Founder of Developers Code from India.His articles mainly focus on .Net (Web and Windows based applications), Mobile Technologies (Android,IPhone,BlackBerry) and SEO.

Labels: , , , ,

2 Comments:

At April 11, 2011 at 2:16 PM , Anonymous Anonymous said...

Thanks For sharing...

 
At June 28, 2011 at 10:16 AM , Anonymous Anonymous said...

Thanks For sharing...

 

Post a Comment

Subscribe to Post Comments [Atom]

<< Home