473,320 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Does .Net allow a ValidationSummary control to be added from code?

I'm trying to add a ValidationSummary control to a common base page used by
all of our system's aspx/ascx files. The base page is a regular class file
that inherits from System.Web.UI.Page. When I debug the application and click
the submit button with a data element that fails a validation, I get the
correct ValidationSummary messageBox, but I then receive the following error
in WebUIValidation.js ValidationSummaryOnSubmit():

Microsoft JScript runtime error: 'style' is null or not an object.

The line that causes the error is: summary.style.display = "none";

I didn't think the ValidationSummary class had a style attribute, but this
same line of code does not cause an error if I add the ValidationSummary
directly to the aspx/ascx page by dragging it from the Toolbox.

In the base page, the following code adds the ValidationSummary control:

System.Web.UI.WebControls.ValidationSummary validationSummary1;
validationSummary1 = new System.Web.UI.WebControls.ValidationSummary();
validationSummary1.ID = "validationSummary1";
validationSummary1.ShowMessageBox = true;
validationSummary1.ShowSummary = true;
form.Controls.AddAt(0,validationSummary1);

--
Any help would be much appreciated!

Regards.
Nov 22 '05 #1
0 1462

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: newusertodotnet | last post by:
I'm trying to add a ValidationSummary control to a common base page used by all of our system's aspx/ascx files. The base page is a regular class file that inherits from System.Web.UI.Page. When I...
0
by: John Mabbott | last post by:
Hello all, We're getting some weird behavior with the ValidationSummary control. If I submit a page that fires some validators, the ValidationSummary displays them correctly. However, if I...
0
by: Mr. x | last post by:
Hello, I am using the validationSummary control. I have a problem, that when nothing is wrong - all fields are required, and there is a value - I still get the message of the...
2
by: Sunil Sabir | last post by:
Dear All, I am using ValidationSummary,RequiredField Validator and Regular Expression Validator in my ASP.net form. I want to display error messages only in the ValidationSummary Control. But...
1
by: Dan Sikorsky | last post by:
I'm using SmartNavigation and need to automatically scroll to the top of the page when the ValidationSummary control catches errors and displays them, so that the user can see the errors without...
5
by: john.livermore | last post by:
I am successfully using the client side validation controls, but there are a couple aspects of their behavior that I wish to modify. I cannot see how to accomplish this through the properties, but...
2
by: c676228 | last post by:
Hi, I have several user controls like email, phone,ssn etc. each has it's own validation message in its user control already. When I bring all those user controls in an aspx page, I would like to...
0
by: Stephen | last post by:
I have a ValidationSummary tag in an aspx page: <asp:ValidationSummary ID="ErrorSummary" ShowSummary="true" DisplayMode="BulletList" HeaderText="Please review the following errors:" runat="server"...
2
by: Code Rodent | last post by:
Hi there, Please please could someone shed some like on a problem that I'm having using a combination of Wizards, ValidationGroups and ValidationSummary controls. What I want to do is to have a...
0
by: Code Rodent | last post by:
Hi there, Please please could someone shed some like on a problem that I'm having using a combination of Wizards, ValidationGroups and ValidationSummary controls. What I want to do is to have a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.