<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.lhotka.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Search results matching tags 'Data binding' and 'ASP.NET'</title><link>http://forums.lhotka.net/search/SearchResults.aspx?a=0&amp;o=DateDescending&amp;tag=Data+binding,ASP.NET&amp;orTags=0</link><description>Search results matching tags 'Data binding' and 'ASP.NET'</description><dc:language>en-US</dc:language><generator>CommunityServer 2008.5 SP3 (Build: 36.8414)</generator><item><title>WebForms UI validation</title><link>http://forums.lhotka.net/forums/p/8958/42625.aspx#42625</link><pubDate>Wed, 19 May 2010 12:39:16 GMT</pubDate><guid isPermaLink="false">49a2225a-bd1e-4c5d-a665-720b81e87ca9:42625</guid><dc:creator>juhilt</dc:creator><description>&lt;p&gt;Hello!&lt;/p&gt;
&lt;p&gt;I am new to the CSLA .NET and I am wondering how the CSLA business entities can be used with Web Forms UI. I am going to use CSLA 3.8 with .NET 3.5 Framework.&lt;/p&gt;
&lt;p&gt;How can I for example use validation rules from the business entity to validate multiple textboxes?&lt;/p&gt;
&lt;p&gt;How does the validation logic for example handle type casting from string to int and give a reasonable error messages to user when using data binding? Does type casting error stop validation, does it continue or does it crash the whole application? Can I call the validation to test if the user input can be type casted?&lt;/p&gt;
&lt;p&gt;How can I for example change the color of a specific textbox to red when validation or type casting of the data fails? Is there some way to map the UI element to the business entity property or do I need to create a mapper by my self? If latter, how should I do it?&lt;/p&gt;
&lt;p&gt;A very simple example&lt;/p&gt;
&lt;p&gt;Web form&lt;/p&gt;
&lt;p&gt;First name: [textbox]&lt;/p&gt;
&lt;p&gt;Last name: [textbox]&lt;/p&gt;
&lt;p&gt;Age: [textbox]&lt;/p&gt;
&lt;p&gt;Organisation id: [textbox]&lt;/p&gt;
&lt;p&gt;Business entity&lt;/p&gt;
&lt;p&gt;string FirstName {get; set;}&lt;/p&gt;
&lt;p&gt;string LastName {get; set;}&lt;/p&gt;
&lt;p&gt;int Age {get; set;}&lt;/p&gt;
&lt;p&gt;int OrganisationId {get; set;}&lt;/p&gt;</description></item></channel></rss>