Forums » .NET » ASP.NET »

Put an asterisk(*)in red color beside a textbox control


Posted Date: 13 Mar 2009      Posted By:: satya     Member Level: Silver    Member Rank: 2727     Points: 1   Responses: 4



Hi,

I want to put an asterisk(*)in red color beside a textbox control which is mandatory field in a webpage.Can u please tell me how to do that. I will appreciate your help.

Thanks




Responses

#355750    Author: Rajapandian      Member Level: Gold      Member Rank: 244     Date: 13/Mar/2009   Rating: 2 out of 52 out of 5     Points: 2

Hi,

In aspx page before that textbox add below line.

<em id="mandatory" style="color:Red">*</em>

Regards,
Rajapandian
.Net & SharePoint



 
#355752    Author: Shreekumar      Member Level: Gold      Member Rank: 0     Date: 13/Mar/2009   Rating: 2 out of 52 out of 5     Points: 2

Here's the code for .aspx file


< asp:TextBox ID="YourId" runat="server" > < /asp:TextBox >
< span style="color: red" > * < /span >


Shreekumar. S. S
Hobby web developer

Specialized in ASP.Net 2.0, SQL Server 2000, C#, AJAX
I Me Myself with ASP.Net



 
#355759    Author: Miss Meetu Choudhary        Member Level: Gold      Member Rank: 14     Date: 13/Mar/2009   Rating: 2 out of 52 out of 5     Points: 2

use the span tag where ever you want to put the red * like

< span style="color: red" > * < /span >

Thanks and Regards
Miss Meetu Choudhary (Site Coordinator)
Go Green Save Green
My Profile on Google






 
#355766    Author: Babu Akkandi      Member Level: Gold      Member Rank: 48     Date: 14/Mar/2009   Rating: 2 out of 52 out of 5     Points: 2

Hi,

this is another way to implement,

place Requirefield validator control next to the each Textbox which are all mantatory,

set following property in Requirefield validator control, thru property window(F4)

errormessage = "*"
controltovalidate = textboxname

when you submit the value, if the value is missed in the text box, then it will display "*" in red color, as you expects.

Hope it Helps!

Note: Plz rate this answer, if it helped you!!

Thanks and Regards,
Babu Akkandi
Microsoft Technology



 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : How to write the output os response.write at the bottom of the page
Previous : How to validatate a textbox for string in asp.net
Return to Discussion Forum
Post New Message
Category:

Related Messages
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.