Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 651025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:07:03+00:00 2026-05-13T22:07:03+00:00

I have an asp:FormView on a control (in an ascx file) which is loaded

  • 0

I have an asp:FormView on a control (in an ascx file) which is loaded onto a portal page along with some other controls.

I need to add validation to the form, but when I add any of the validation controls I get an apparently random error in the generated JavaScript when the page is loaded, and the validation doesn’t fire when I need it to.

This is the code that I’ve got:

<asp:TextBox ID="FPITextBox4" runat="server" Text='<%# Bind("SomeNumber") %>'></asp:TextBox>
<asp:RangeValidator ID="RangeValidator4" runat="server" ControlToValidate="FPITextBox4" Text="*"
    ErrorMessage="The number must be a whole number between 0 and 100,000" Type="Integer"
    MaximumValue="100000" MinimumValue="0" ToolTip="Must be between 0 and 100,000"></asp:RangeValidator>

This is the error I get when the page is loaded:

Message: Expected ';'
Line: 1159
Char: 60
Code: 0

When I look at line 1159 in the generated code it looks like this:

var ctl00_ctl00_main_col2_control_0_widgetcontrolX_3eba4918-7c7d-47aa-a089-
fd0ead0609fe_widgetcontrol_3eba4918-7c7d-47aa-a089-
fd0ead0609fe_FormView1_RangeValidator4 = document.all ?
document.all["ctl00_ctl00_main_col2_control_0_widgetcontrolX_3eba4918-7c7d-47aa-a089-
fd0ead0609fe_widgetcontrol_3eba4918-7c7d-47aa-a089-
fd0ead0609fe_FormView1_RangeValidator4"] :
document.getElementById("ctl00_ctl00_main_col2_control_0_widgetcontrolX_3eba4918-7c7d-
47aa-a089-fd0ead0609fe_widgetcontrol_3eba4918-7c7d-47aa-a089-
fd0ead0609fe_FormView1_RangeValidator4");

The code immediately above this is:

<script type="text/javascript"> 
//<![CDATA[
var Page_Validators =  new Array(document.getElementById(
"ctl00_ctl00_main_col2_control_0_widgetcontrolX_3eba4918-7c7d
-47aa-a089-fd0ead0609fe_widgetcontrol_3eba4918-7c7d-47aa-a089-
fd0ead0609fe_FormView1_RangeValidator4"));
//]]>
</script>

The same code works when the control is just instantiated onto a test page all by itself.

It appears that the error only happens in IE 8. I’ve tested the same page in Firefox 3.6 and it all works as expected.

Correction

It appears that the validation is working. I had a ValidationSummary control set to show a message box and that wasn’t appearing which led me to believe that the validation wasn’t firing. When I changed that to ShowSummary="true" ShowMessageBox="false" the error message did appear and the data isn’t saved.

So all it means now is that I’ve got a random script error that (at the moment) doesn’t appear to be affecting the workings of the page.

However, I would still like to remove the error – just in case it’s hiding something else.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:07:04+00:00Added an answer on May 13, 2026 at 10:07 pm

    you really found a bug in .Net client generation code – have a look at
    http://haacked.com/archive/2006/07/14/ASP.NET2.0ClientValidationJavascriptBug.aspx

    But no resolution from M$ – you’ll have to generate IDs in a different way…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ASP.NET page with a FormView control. When the FormView is bound
I have a FormView control in an ASP.NET page. I use the InsertItemTemplate and
Greetings! I have a DropDownList within a FormView which are bound to XmlDataSources: <asp:FormView
I have some ASP.NET web services which all share a common helper class they
I have an asp:FormView control bound to a datasource. Everything is working fine. If
I have FormView in my page markup: <asp:FormView ruanat=server ID=FormView1 DataSourceID=SqlDataSource1 OnDataBinding=FormView1_DataBinding OnDataBound=FormView1_DataBound> <InsertItemTemplate>
I have a FormView control in an ASP.NET 2.0 app. I've got the database
Greetings! I have a Repeater control that's using an XmlDataSource control. <asp:FormView id=myFormView runat=server
I have two dropdownlist, a detailsview and a formview control in my page. The
I have an ASP.NET page with a Wizard control containing several pages of form

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.