<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Problem in OnAfterCahnge event</title><link>https://www.infopathdev.com:443/forums/thread/14298.aspx</link><pubDate>Thu, 16 Feb 2006 13:24:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14298</guid><dc:creator>vt_asparagus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14298.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14298</wfw:commentRss><description>Becuase the return message is in OnBeforeChange to send a user a message if you are not going to allow the change to continue.  In the case of OnAfterChange, the change has been committed to the DOM.</description></item><item><title>Problem in OnAfterCahnge event</title><link>https://www.infopathdev.com:443/forums/thread/12776.aspx</link><pubDate>Wed, 15 Feb 2006 06:50:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12776</guid><dc:creator>liorlankri</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12776.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12776</wfw:commentRss><description>I Have a text box and I write this code in the OnBeforeChange Event:&lt;br /&gt;&lt;br /&gt;If eventObj.IsUndoRedo Then&lt;br /&gt;   Exit Sub&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;If eventObj.Operation="Delete" Then&lt;br /&gt;   Exit Sub&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;dim str1&lt;br /&gt;&lt;br /&gt;str1=eventObj.NewValue&lt;br /&gt;&lt;br /&gt;if len(str1)&amp;lt;4 then&lt;br /&gt;eventObj.ReturnStatus=false&lt;br /&gt;eventObj.ReturnMessage="should be more than 4"&lt;br /&gt;end if&lt;br /&gt;&lt;br /&gt;That code work. But when I write the same code in the OnAfterChange Event I dont get the ReturnMessage. I get it only if I change it to:&lt;br /&gt;&lt;br /&gt;XDocument.UI.Alert("should be more than 4")&lt;br /&gt;&lt;br /&gt;Why it's happen???</description></item></channel></rss>