How to get the text rendered by ValidationSummary control?http://forums.asp.net/t/1384348.aspx/1?How+to+get+the+text+rendered+by+ValidationSummary+control+Fri, 13 Feb 2009 02:19:38 -050013843482938274http://forums.asp.net/p/1384348/2938274.aspx/1?How+to+get+the+text+rendered+by+ValidationSummary+control+How to get the text rendered by ValidationSummary control? <p>I'll start moving some of the questions that we have gotten from our blog and code plex over to the forum so that they are easier to search. <br> </p> <p><b>Q</b>: I'm having trouble finding a way to look at a ValidationSummary server side conrtol to see the errors that were added. I can find the control using HtmlPage.Elements.Find(&quot;&quot;) but how do I see the text/html?</p> <p><b>A</b>: Here is a sample test to verify the text of the validatiosummary: </p> <p>&nbsp;</p> <pre class="prettyprint">HtmlPage p = new HtmlPage(&quot;Login.aspx&quot;); p.Elements.Find(&quot;Button1&quot;).Click(); string errorMessages = p.Elements.Find(&quot;ValidationSummary1&quot;).GetInnerTextRecursively(); Assert.StringContains(errorMessages, &quot;Name is Required&quot;); Assert.StringContains(errorMessages, &quot;Password is Required&quot;);</pre>&nbsp;- Federico<br> <p>&nbsp;</p> 2009-02-13T02:19:38-05:00