473,766 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 RequiredFieldVa lidator in the
FooterTemplate. Doing so causes the following Javascript error:
'Page_Validator s' 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:LinkButt on CommandName="Ad dNewRecord" Text="Add Custom Threshold"
ID="lnkAddThres hold" Runat="server"/>
<asp:RequiredFi eldValidator ID="reqDdThresh oldUpperAddNew"
ControlToValida te="txtDdThresh oldUpperAddNew" ErrorMessage="P lease enter a
value" Display="Dynami c" Visible="True" Runat="server"/>
</FooterTemplate>

Code Behind snippet:

protected void BindGrid()
{
//Set each grid's datasource and bind to it
dgDDThresholdDa ta.DataSource=D ataAccess.clsCo mmonAccess.getD BValues();
dgDDThresholdDa ta.DataBind();

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

Apr 6 '06 #1
0 1187

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

Similar topics

2
1567
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 non-scrooling region at the bottom of the screen where I could display a footer. Is there any known scripts doing that? thank you in advance serge
17
4008
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" <DIV id="LeftNavigation" style="position:absolute; left:8px; top:6px; width:200p ------- Line 47, column 127: element "DIV" undefined
9
5065
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: ******************************************************************************* <asp:DataGrid visible="False" border=1
1
1667
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 type of behaviour before? Can anyone suggest a solution? Thanks in advance, Stu
1
1409
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 'Page Validator' not defined javascript errors when any unrelated link buttons are clicked. I have tried setting the enabled property to false, but that had no effect. When i have the datagrid footer displayed no errors occur. But that kind of
3
6067
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 another button. DBEditDataGrid.ShowFooter := true; DBEditDataGrid.SelectedIndex := DBEditDataGrid.Items.Count; LoadDataFromDB; DataBindGrid;
0
7860
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 displaying anything in the footer of the gridview. Below is my code colA
0
2708
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 row. I would like to display the footer row, only when a LinkButton "Add New" is clicked. And after the new record is saved to the database, let the footer row disappear. In the LinkButton's click event handler, I simply say:
1
2773
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. The exact error is "targetedControl has no properties". Looking at the .net script it looks like there is an event object that is expected to have an object named either srcElement or target which I would guess is the foem element to be validated....
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10008
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.