Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use of Rules.Parital.cs Question
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Use of Rules.Parital.cs Question
Miscellaneous
Thread ID:
01494437
Message ID:
01494437
Views:
117
Need to implement forcing of upper case on certain fields on aspx web pages. After much googling, it appears there is simply no existing format string I could put in the DisplayFormat that will both display data entered as upper and force the underlying value to upper. Most of the solutions I found involved javascript and other kludges I am not interested in.

This is solution I am trying, but I have concerns whether this is kosher in the underlying MM.NET framework. Please comment.

1. On the ASPX weg page, you can declare more than one CSS style, as follows. Not the two classes, one displays color code for readwrite enabled fields on a screen, the second forces sting value to display as upper case.
<mm:mmTextBox ID="txtAmateurCertFinal" runat="server" BindingSource="SaProspects" 
            CssClass="TextBox-ReadWrite UpperCase" Width="33px" 
               BindingSourceMember="AMATEURCERTFINAL" ></mm:mmTextBox>
2. In the bizobjRules.Partial.cs, for each attribute I want to apply an action to, this:
	public partial class SaProspectsRules
	{
		public override void CheckExtendedRulesHook<EntityType>(EntityType currentEntity)
		{
			SaProspectsEntity Entity = currentEntity as SaProspectsEntity;
			
			// Call Validation methods

            Entity.AMATEURCERTFINAL = Entity.AMATEURCERTFINAL.ToUpper();

		}
I just tried this, and it works. After saving the data from the form with a this.Save() MM.NET command, I walk through the code, it hits the above rule, and applies it, and the upper cased value is written back to the database record.

So what is the question? I am sort of assuming obviously that the rules are applied on a record by record basis as each record is processed, in case there could ever be multiples in the entity being saved??

This seems like a really logical way to put this conversion of the data where it belongs, in a business object, not in the web page.

Thanks,

Ronald D. Edge
Director of Information Services
Indiana University Athletics
1001 East 17th St Bloomington , IN 47408
edge@indiana.edu
Ronald D. Edge
Retired from Indiana University Mar 1, 2011

"You've got to be very careful if you don't know where you are going,
because you might not get there."
“When you come to the fork in the road, take it.”
--Yogi Berra
Next
Reply
Map
View

Click here to load this message in the networking platform