Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
ASP .Net
Hidden Validators Cause Javascript Error
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="news.microsoft.com, post: 526574"] I am going crazy trying to figure this out, and I am wondering if this is a bug in the ASP.Net 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.clsCommonAccess.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? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
ASP .Net
Hidden Validators Cause Javascript Error
Top