I have made a custom section. I would like to make some fields mandatory and wondering if there some api calls I can use to help make the validation summary appear at the top when errors occur, and be style appropriately. I've search alot but minimal results of interest appear. Some were related to document types and other areas but not custom sections which seemed different.
Tom is right. Best way is to use the default ValidationSummary and don't give it a ValidationGroup. Here is how I do it (which looks exactly like the default error message).
<%--ValidationSummary--%>
<asp:ValidationSummary runat="server" DisplayMode="BulletList" ID="ValidationSummaryDetails" CssClass="error validationSummaryTop" HeaderText="<h3>The data has not been saved because there are some errors you need to fix first:</h3>"></asp:ValidationSummary>
Custom section field validation
Hi,
I have made a custom section. I would like to make some fields mandatory and wondering if there some api calls I can use to help make the validation summary appear at the top when errors occur, and be style appropriately. I've search alot but minimal results of interest appear. Some were related to document types and other areas but not custom sections which seemed different.
What I have so far....
Thanks for any help!
Hi Peter,
There aren't any APIs that I know of for this, but I've done it the same way as you and mimiced the umbraco styles using this:
(set the Panel to visible if errors)
HTH,
Tom
Tom is right. Best way is to use the default ValidationSummary and don't give it a ValidationGroup. Here is how I do it (which looks exactly like the default error message).
Jeroen
Righto thanks guys, will stick with that approach.
Jeroen's looks better :) For some reason I didn't think you could put HTML tags (<h3>) in the HeaderText property so I wrapped in a panel instead.
-Tom
I believe that there is a better way to do this, and sorry I know this is an old thread but look at the following:
in the button save click event at the top put in this (here tabControl is the TabView id.
Remember to disable clientside validation either pr. page or pr. control.
aspx file
code behind
And that's it actually!
Any comments are apreciated.
is working on a reply...