Error when placing Validators on a DataList Control.

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Error when placing Validators on a DataList Control.

    We are using .NET validators on most of our aspx pages.
    When the validator is contained within a datalist (i.e.
    the EditItemTemplate) the WebUIValidation.js file location
    tag is not rendered on the page.

    Missing Tag:
    <script language="javascript"
    src="/aspnet_client/system_web/1_0_3705_0/WebUIValidation.j
    s"></script>

    When we attempt to edit the item we receive the following
    error message:

    Error Message:
    Unable to find script
    library '/aspnet_client/system_web/1_0_3705_0/WebUIValidati
    on.js'. Try placing the file manually.


    If the validators are located directly on the page and not
    in the datalist, the tag is rendered correctly.

    1) We can hard code the path on each page but this creates
    maintenance issues.

    2) If we add a hidden field with a default value and a
    required field validator on the page, the tag is
    rendered. This is successful but not very clean.

    I would like to do one of the following.

    1) Trigger the rendering of this tag in code. I have been
    unsuccessful in this regard.

    2) Dynamically read the file location and render the tag.
    I can read the cryptic path "/aspnet_client/{0}/{1}/"
    from the machine.config file but I have been unsuccessful
    translating it.

    Dim configData As IDictionary = context.GetConfig
    ("system.web/webControls")
    Response.Write(configData("clientScriptsLocation") )

    We are currently running the .NET Framework 1.0 SP2. Any
    thoughts would be greatly appreciated.

    Thanks,
    Art Kedroski




    Art Kedroski Guest

  2. Similar Questions and Discussions

    1. Paging for DataList Control
      Hi Like datagrid, there is no paging for DataList control How to get paging for datalist? thanks NagaKiran
    2. DATALIST control
      Hello, I have a doubt... I have a TextBox by name txtMessage.Text ,Button by name btnSend and Datalist Control by name dltMessage i my aspx...
    3. DataList parrent control with a Repeater child control
      I've been trying to bind a Repeater 'child control' to a DataList control and seem to have lost the plot. Tec spec: Connection to SQL server 2...
    4. Validators in a user control
      ive made a usercontrol with some textboxes. ive added some required field validators to the textoxes. i made a page with a button and my user...
    5. Required field validators do not while editing a row in a datagrid present in a composite control
      Hi All, I have created a composite control and I have added a datagrid in it. I am dynamically adding an edit column for editing the data. Now I...
  3. #2

    Default Re: Error when placing Validators on a DataList Control.


    "Art Kedroski" <kedroski@eglin.af.mil> wrote in message
    news:5fce01c3579d$bfdd4fe0$a001280a@phx.gbl...
    > We are using .NET validators on most of our aspx pages.
    > When the validator is contained within a datalist (i.e.
    > the EditItemTemplate) the WebUIValidation.js file location
    > tag is not rendered on the page.
    >
    > Missing Tag:
    > <script language="javascript"
    > src="/aspnet_client/system_web/1_0_3705_0/WebUIValidation.j
    > s"></script>
    >
    > When we attempt to edit the item we receive the following
    > error message:
    >
    > Error Message:
    > Unable to find script
    > library '/aspnet_client/system_web/1_0_3705_0/WebUIValidati
    > on.js'. Try placing the file manually.
    >
    >
    > If the validators are located directly on the page and not
    > in the datalist, the tag is rendered correctly.
    >
    > 1) We can hard code the path on each page but this creates
    > maintenance issues.
    >
    > 2) If we add a hidden field with a default value and a
    > required field validator on the page, the tag is
    > rendered. This is successful but not very clean.
    >
    > I would like to do one of the following.
    >
    > 1) Trigger the rendering of this tag in code. I have been
    > unsuccessful in this regard.
    >
    > 2) Dynamically read the file location and render the tag.
    > I can read the cryptic path "/aspnet_client/{0}/{1}/"
    > from the machine.config file but I have been unsuccessful
    > translating it.
    >
    > Dim configData As IDictionary = context.GetConfig
    > ("system.web/webControls")
    > Response.Write(configData("clientScriptsLocation") )
    >
    > We are currently running the .NET Framework 1.0 SP2. Any
    > thoughts would be greatly appreciated.
    >
    > Thanks,
    > Art Kedroski
    >
    >
    >
    >
    Do you have Smart Navigation turned on? When I used to on my pages I got
    this error all the time. I turned it off and the errors went away :)


    Krissy Guest

  4. #3

    Default Re: Error when placing Validators on a DataList Control.

    Thanks for the feedback. Unfortunately I still get the error popup.
    Just to give you a little more history, the browser setting is essential
    to recreating the popup error. However, the browser setting does not
    affect the rendering of the tag into html. If the setting is changed,
    the .js file is cached and the error does not occur. Under any of the
    described scenarios, the tag does not get rendered.

    Browser setting to recreate the issue: Tools / Internet Options /
    Settings / Check for newer versions of stored pages Every visit to the
    page.

    Art Kedroski


    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Art Thomas Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139