Im working on a website built using .net which I’ve never worked with before.
I have this string of code…
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="V1" Display="Dynamic"
ErrorMessage="Please fill in your name" ControlToValidate="TB_Name"></asp:RequiredFieldValidator>
Which outputs a textfield and if an error occurs display the ‘ErrorMessage’ text wrapped in a span. I need to move this error message span elsewhere on the page however, Is it possible to strip it from the code somehow?
Sorry if this doesnt make sense Im a bit confused myself!
I’ve trie to add Validation Summary at the bottom of my page only nothings being output to it when it should be, does the Id need to be linked to anything?..
<asp:ValidationSummary
id="valSum"
DisplayMode="BulletList"
runat="server"
HeaderText="Summary of Validation Errors:"
/>
Change the
Displayattribute on the validation control toNone.Then create a
ValidationSummarycontrol where you’d like to display your errors ( guessing you want them all in the same place ).ValidationSummary is a control that looks for all validators matching its ValidationGroup, and will display all errors for that group in a single place.