473,396 Members | 1,849 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,396 software developers and data experts.

Validator in Footer Causing Javascript Error (with ShowFooter)

I am going crazy trying to figure this out, and I am wondering if this is a
bug in the ASP.Net 1.1 implementation.

My situation:

I have an ASPX page with 2 different modes:

*Mode 1: Datagrid with no footer
*Mode 2: Datagrid with a footer template containing a textbox and an "Add
Record" command (also has an edit column)

Everything works fine until I put a RequiredFieldValidator in the
FooterTemplate. Doing so causes the following Javascript error:
'Page_Validators' is undefined. I believe this is happening because I am
dynamically showing / hiding the footer in my code-behind, depending on a
selected dropdown value within the page.

Is there a workaround / solution for this?

Footer Template snippet:

<FooterTemplate>
<asp:LinkButton CommandName="AddNewRecord" Text="Add Custom Threshold"
ID="lnkAddThreshold" Runat="server"/>
<asp:RequiredFieldValidator ID="reqDdThresholdUpperAddNew"
ControlToValidate="txtDdThresholdUpperAddNew" ErrorMessage="Please enter a
value" Display="Dynamic" Visible="True" Runat="server"/>
</FooterTemplate>

Code Behind snippet:

protected void BindGrid()
{
//Set each grid's datasource and bind to it
dgDDThresholdData.DataSource=DataAccess.clsCommonA ccess.getDBValues();
dgDDThresholdData.DataBind();

//If we are showing a custom version of the form, then allow
editing/adding/deleting of values
if(Convert.ToInt32(intThresholdTypeID)==2)
{
dgDDThresholdData.Columns[6].Visible=true; //show the edit column
dgDDThresholdData.Columns[7].Visible=true; //show the delete column
dgDDThresholdData.ShowFooter = true; //show the footer (add new
record)
}
else
{
dgDDThresholdData.Columns[6].Visible=false; //hide the edit column
dgDDThresholdData.Columns[7].Visible=false; //hide the delete column
dgDDThresholdData.ShowFooter = false; //hide the footer (add new
record)
}
}
Any ideas?

Apr 6 '06 #1
0 1171

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

Similar topics

2
by: Serge Myrand | last post by:
Hi, I look for a way to display a footer at the bottom of most of my ASP pages but not at all. I think that IIS 5 can do it but for all pages. In fact, what I look for, is a kind of...
17
by: Colin Cogle | last post by:
------- Line 47, column 8: there is no attribute "id" <DIV id="LeftNavigation" style="position:absolute; left:8px; top:6px; width:200p ------- Line 47, column 31: there is no attribute "style"...
9
by: tshad | last post by:
How do I find (and set) a couple of labels in the Footer after a DataGrid is filled? I have a bunch of DataGrids that get displayed nested inside a DataList. The datagrid looks like: ...
1
by: Stu | last post by:
Hi, I have a button in the footer of a datagrid that sometimes does not tigger the item command. The page is quite large & has a number of homegrown controls in it. Has anyone come across this...
1
by: Adam Knight | last post by:
Hi all, I have a asp:required field validator in a datagrid footer containing a textbox control. (To add new row) I have an issue in that while the footer is hidden and not required it is cause...
3
by: williamfrenette | last post by:
To add record into my grid I use the footer way like explain here : http://aspnet.4guysfromrolla.com/articles/021203-1.aspx But i dont want a Add button on each row so i call the showfooter with...
0
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I have to display total time in the footer of my gridview so I have a columnn a. I followed micrososft example to create the footer and display the total time and it is not...
0
by: gnewsgroup | last post by:
Well, I am trying to use the footer row of a GridView for insertion purpose. There are some articles about this, for example, the gridviewguy.com has an example, which always displays the footer...
1
by: onseats.ky | last post by:
I have a strange problem with a required field validator when I have EnableClientScript set to true. When the client side validation fires I get a javascript exception inside the .net javascript....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.