Sys is undefined

27 posts, 0 answers
  1. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 04 May 2007 Link to this post

    Hi,
    just tried to make a simple tooltip - and got following javascript error when runing the page - 'Sys' is undefined
    debug stops at:

    Sys.WebForms.PageRequestManager._initialize(
    'ScriptManager1', document.getElementById('form1'));

    perhaps i missed something?
    here aspx:

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
    <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
        Namespace="System.Web.UI" TagPrefix="asp" %> 
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> 
     
    <html xmlns="http://www.w3.org/1999/xhtml" > 
    <head id="Head1" runat="server">  
        <title>Untitled Page</title> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
        <div> 
                <asp:TextBox ID="txtWithTooltip" runat="server">123</asp:TextBox> 
                <img src="HelpIcon.gif" runat="server" ID="lblPrev" alt="" style="margin-left:17px;vertical-align:middle;"/>  
                <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="txtWithTooltip" Text="This is a tooltip" IsClientID="true">  
                </telerik:RadToolTip> 
                <telerik:RadToolTip ID="RadToolTip2" runat="server" TargetControlID="lblPrev" Sticky="true" RelativeTo="Element" Skin="Web20Green" Position="BottomCenter" Text="Previous article: USNews Top 10" IsClientID="true">  
                </telerik:RadToolTip> 
          
        </div> 
        </form> 
    </body> 
    </html> 
     
  2. surfer
    surfer avatar
    585 posts
    Member since:
    Jul 2003

    Posted 04 May 2007 Link to this post

    I've got a setup almost 1:1 with your and it is working without issues. The only major difference I'm seeing in your approach is the explicit Register clause from the MS Extensions (MS AJAX). I'm not sure if this is enough for the project to support MS AJAX.

    If you start a new project and use the New Ajax-Enabled web-site template, VS.NET adds a lot of additional stuff to your web.config file, which might be required. For example, here is my autogenerated (from VS.NET web.config file)

    <?xml version="1.0"?> 
    <configuration> 
        <configSections> 
            <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                    <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                    <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                        <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/> 
                        <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                        <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/> 
                    </sectionGroup> 
                </sectionGroup> 
            </sectionGroup> 
        </configSections> 
        <system.web> 
            <pages> 
                <controls> 
                    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
                </controls> 
            </pages> 
            <!-- 
              Set compilation debug="true" to insert debugging 
              symbols into the compiled page. Because this 
              affects performance, set this value to true only 
              during development. 
        --> 
            <compilation debug="true"
                <assemblies> 
                    <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
                    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies> 
            </compilation> 
            <httpHandlers> 
                <remove verb="*" path="*.asmx"/> 
                <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
                <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
                <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/> 
            </httpHandlers> 
            <httpModules> 
                <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
            </httpModules> 
        </system.web> 
        <system.web.extensions> 
            <scripting> 
                <webServices> 
                    <!-- Uncomment this line to customize maxJsonLength and add a custom converter --> 
                    <!-- 
          <jsonSerialization maxJsonLength="500"
            <converters> 
              <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/> 
            </converters> 
          </jsonSerialization> 
          --> 
                    <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. --> 
                    <!--
            <authenticationService enabled="true" requireSSL = "true|false"/>
          --> 
                    <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved 
               and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and 
               writeAccessProperties attributes. --> 
                    <!-- 
          <profileService enabled="true" 
                          readAccessProperties="propertyname1,propertyname2" 
                          writeAccessProperties="propertyname1,propertyname2" /> 
          --> 
                </webServices> 
                <!--
          <scriptResourceHandler enableCompression="true" enableCaching="true" />
          --> 
            </scripting> 
        </system.web.extensions> 
        <system.webServer> 
            <validation validateIntegratedModeConfiguration="false"/> 
            <modules> 
                <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
            </modules> 
            <handlers> 
                <remove name="WebServiceHandlerFactory-Integrated"/> 
                <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
                <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
                <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> 
            </handlers> 
        </system.webServer> 
    </configuration> 
     

    Maybe, adding these web.config clauses will address the problem? Or the easier approach - start direclty with the Ajax-Enabled Web Site template which should be available in VS.NET New Project after installing MS Ajax Extensions.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 04 May 2007 Link to this post

    Thanks surfer, that was it! I did not aware that i have to start with Ajax-Enabled web-site template

    Works now!
  5. sl6rp
    sl6rp avatar
    55 posts
    Member since:
    Sep 2012

    Posted 10 May 2007 Link to this post

    Has anyone an idea of how to integrate this into an existing web application?  I keep getting the same 'Sys' undefined error.  I have successfully built the example when I start a new Ajax-enabled website but ideally I would like to add this functionality to an existing page within a web application.

    Thanks

  6. surfer
    surfer avatar
    585 posts
    Member since:
    Jul 2003

    Posted 10 May 2007 Link to this post

    First, you need to install MS AJAX Extensions. This will place the MS AJAX assembly in your GAC. Alternatively, you can copy it to the /bin of your web-application explicitly - the DLL name is System.Web.Extensions.dll.

    After that, you need to drop an asp:ScriptManager in your page (you can add System.Web.Extensions.dll to your toolbox and drop ScriptManager from there).

    Finally, you will need to modfy your web.config - check out the web.config I attached in my previous post - all lines containing references to System.Web.Extensions are needed in your web.config. You can also directly copy / paste the web.config from a fresh MS AJAX application onto your web.config if it does not contain application specific info (or merge them).
  7. sl6rp
    sl6rp avatar
    55 posts
    Member since:
    Sep 2012

    Posted 10 May 2007 Link to this post

    Surfer,

    Thanks for the quick reply.  I had intalled the MS AJAX extension and had a scriptmanager on the page.  I had even copied the sample web.config file you had posted previously.  What finally worked for me was placing the updated web.config file on the root of my web application.  Initially I had only been updating the web.config file on the portion of my web site that required a login.

    Thanks for the good information.

    -Brent
  8. surfer
    surfer avatar
    585 posts
    Member since:
    Jul 2003

    Posted 10 May 2007 Link to this post

    Glad I was able to help (and I also learned something along the way!) - thanks for sharing your experience.

    I have cross checked the Prometheus docs and while there is information there how to proceed from a fresh new ASP.NET AJAX Web-Site, it does not provide information how to proceed with an existing vanilla ASP.NET 2.0 site - and this will be the most common starting point, I am sure, for quite some time.

    This thread provides a lot of useful information that might be included in the docs in next releases of the Prometheus suite. Hopefully they will be included in the docs.

    Cheers,
    ~Matt
  9. Alex Dybenko
    Alex Dybenko avatar
    119 posts
    Member since:
    Jan 2005

    Posted 11 May 2007 Link to this post

    Hi,
    i think best approach - is to check web.config settings when inserting Prometheus controls or running it and notify user that ajax settings are missing. Hope telerik read this and can consider this option in release

    Alex
  10. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 11 May 2007 Link to this post

    Hello Alex,
    Thank you for the suggestions. We will research whether this can be done and implement it if possible. We will definitely add instructions in the documentation for using our Prometheus controls in existing ASP.NET 2.0 site.

    Kind regards,
    Tsvetie
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  11. surfer
    surfer avatar
    585 posts
    Member since:
    Jul 2003

    Posted 11 May 2007 Link to this post

    Yep, definitely - a "ScriptManager not present in the Page" error message, hopefully with a link to an online article describing how to add ScriptManager and all required settings for MS AJAX in web.config will be much more convenient than the current "Sys is undefined message", which is cryptic to most developers.

    Hope this will be updated for SP1.
  12. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 15 May 2007 Link to this post

    Just to clarify for the group, the "'Sys' is undefined" error is technically related to any MS AJAX application. Sys is the root namespace for all MS AJAX client classes, so this error is common if you have not properly loaded the MS AJAX libraries. The most common problems are:
    1. Missing ScriptManager
    2. Badly configured Web.Config that doesn't contain definition for ScriptResources handler
    3. HttpCompression module "breaking" ScriptHandler.axd output to browser
    Obviously, "Prometheus" controls will throw this error too when MS AJAX is not properly loaded on the client. This is just something to watch for if your adding MS AJAX to your site.

    Thanks~
  13. Shaun Peet
    Shaun Peet avatar
    571 posts
    Member since:
    Aug 2004

    Posted 15 May 2007 Link to this post

    More good news and bad news.

    The good news is that Visual Studio 2007 will automatically convert a .NET 2.0 app to a .NET 3.5 app, making all the appropriate modifications to the web.config along the way while preserving all other customizations.

    The bad news is that Visual Studio 2007 isn't officially available yet.
  14. Kevin
    Kevin avatar
    549 posts
    Member since:
    Nov 2006

    Posted 15 May 2007 Link to this post

    Sys is undefined may indeed happen for a variety of reasons, mostly unrelated to Prometheus controls. I've found a great blog post that describes everything about this error message and ways to deal with it in detail, hopefull it will be useful for the community.

    Original blog post and credit goes ot Matt Gibbs
    http://weblogs.asp.net/chrisri/archive/2007/02/02/demystifying-sys-is-undefined.aspx

    Demystifying ‘Sys is undefined’

    Are you running into this error on your ASP.NET AJAX enabled web site? Does it only happen on some machines or on some browsers? Here’s how you can get to the bottom of it.

    Here's a little background on what is happening…

    When you have a ScriptManager on a page, ASP.NET AJAX will render a few script tags to load the various ASP.NET AJAX Scripts, and some inline script to get everything initialized and running. If you view source on the page as rendered by your browser, you should see something like this:

        <script type="text/javascript">
        Sys.WebForms.PageRequestManager._initialize('ScriptManager1', document.getElementById('form1'));
        Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90);
        </script>

    When the browser goes to run that code, it’s going to expect Sys.WebForms.PageRequestManager to be defined somewhere. That somewhere happens to be in the other scripts that are loaded from script tags that look like this:

        <script src="/MyWebApp/ScriptResource.axd?[snip - long query string]" type="text/javascript"></script>

    If the browser fails to load those scripts, the script engine can’t find the definition for Sys, Sys.WebForms, Sys.WebFormsPageRequestManager, and thus the error.

    So why would those scripts fail to load? We’ve seen several reasons:

    1. The browser fails to load the compressed script

    This is usually the case if you get the error on IE6, but not on other browsers.

    The Script Resource Handler – ScriptResource.axd compresses the scripts before returning them to the browser. In pre-RTM releases, the handler did it all the time for all browsers, and it wasn’t configurable. There is an issue in one of the components of IE6 that prevents it from loading compressed scripts correctly. See KB article here. In RTM builds, we’ve made two fixes for this. One, we don’t compress if IE6 is the browser client. Two, we’ve now made compression configurable. Here’s how you can toggle the web.config.

    How do you fix it? First, make sure you are using the AJAX Extensions 1.0 RTM release. That alone should be enough. You can also try turning off compression by editing your web.config to have the following:

        <system.web.extensions>
        <scripting>
        <scriptResourceHandler enableCompression="false" enableCaching="true" />
        </scripting>
        </system.web.extensions>

    2. The required configuration for ScriptResourceHandler doesn’t exist for the web.config for your application

    Make sure your web.config contains the entries from the default web.config file provided with the extensions install. (default location: C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025)

    3. The virtual directory you are using for your web, isn’t correctly marked as an application (thus the configuration isn’t getting loaded) - This would happen for IIS webs.

    Make sure that you are using a Web Application, and not just a Virtual Directory

    4. ScriptResource.axd requests return 404

    This usually points to a mis-configuration of ASP.NET as a whole. On a default installation of ASP.NET, any web request to a resource ending in .axd is passed from IIS to ASP.NET via an isapi mapping. Additionally the mapping is configured to not check if the file exists. If that mapping does not exist, or the check if file exists isn't disabled, then IIS will attempt to find the physical file ScriptResource.axd, won't find it, and return 404.

    You can check to see if this is the problem by coipy/pasting the full url to ScriptResource.axd from here, and seeing what it returns

        <script src="/MyWebApp/ScriptResource.axd?[snip - long query string]" type="text/javascript"></script>

    How do you fix this? If ASP.NET isn't properly installed at all, you can run the "aspnet_regiis.exe" command line tool to fix it up. It's located in C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727. You can run "aspnet_regiis -i -enable", which does the full registration of ASP.NET with IIS and makes sure the ISAPI is enabled in IIS6. You can also run "aspnet_regiis -s w3svc/1/root/MyWebApp" to only fix up the registration for your web application.
  15. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 15 May 2007 Link to this post

    Good to know Shaun. For all interested in downloading Beta 1, don't miss the download here:

    http://go.microsoft.com/fwlink/?LinkID=89146&clcid=0x409

    Thanks~
    Todd
  16. CK
    CK avatar
    2 posts
    Member since:
    May 2007

    Posted 15 May 2007 Link to this post

    I ran into a similar issue of upgrading from old ASP.NET version to Ajax enabled app.

    It also came with this line in Web.config:
    xhtmlConformance mode="Legacy

    Which gave PageRequestManger error.
  17. surfer
    surfer avatar
    585 posts
    Member since:
    Jul 2003

    Posted 16 May 2007 Link to this post

    This I believe would be a great resource for the trouble-shooting section of the Prometheus suite help files. It seems that this is one of the most common mistake we will be getting, and since it is a bit cryptic, troubleshooting section on "Sys is undefined" will be more than welcome.
  18. Shaik
    Shaik avatar
    1 posts
    Member since:
    Jun 2008

    Posted 16 Jun 2008 Link to this post


    Because u have not written in .Webconfig file.

     <httpHandlers>
          <add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
          <remove verb="*" path="*.asmx"/>
          <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
        </httpHandlers>
  19. Dave Friedel
    Dave Friedel avatar
    20 posts
    Member since:
    Mar 2004

    Posted 09 Sep 2008 Link to this post

    @ CK

    Thank you SOOOOOO much.

    That should BE PUT in EVERY Telerik Help file.

    I LOST 5 days of work beating my head against this computer.

    To reiterate to everyone -

    Remove this line in Web.config:
    xhtmlConformance mode="Legacy


    Which we did not put in the config ourselves after the VS2008 upgrade.
  20. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 10 Sep 2008 Link to this post

    Hi Dave,

    We will consider adding this information in our documentation. In the meantime you can get more information on it from this blog:
    http://weblogs.asp.net/scottgu/archive/2006/12/10/gotcha-don-t-use-xhtmlconformance-mode-legacy-with-asp-net-ajax.aspx



    All the best,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  21. ytkaczyk
    ytkaczyk avatar
    1 posts
    Member since:
    May 2007

    Posted 12 Sep 2008 Link to this post

    Dave, Georgi,

    Thank you. This saved me a lot of time. I was starting to loose patience an dhope with this issue - working on a legacy application that was migrated from VS2003 and had the compliance tag.

    Yves
  22. Tsang
    Tsang avatar
    1 posts
    Member since:
    Oct 2008

    Posted 16 Oct 2008 Link to this post

    I use window.showModalDialog open a page with ajax tab.
    However there is 'sys is undefined' error.
    Does anyone have solution? Thanks.
  23. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 17 Oct 2008 Link to this post

    Tsang-

    Sorry to hear you're having problems. Have your reviewed the older information in this thread? The error you're hitting is very common with ASP.NET AJAX sites that do not correctly have the ASP.NET AJAX script references defined on the page. The links provided in this thread provide a lot of good debugging help to figure out which of the many problems that cause this you might have.

    If you're having trouble debugging, though, I'd encourage you to start a new thread and provide more details about your setup and your environment so we can try to help troubleshoot. You may also seek help on the official ASP.NET forums to troubleshoot an issue like this.

    Hope that helps.

    -Todd
  24. Darlene
    Darlene avatar
    4 posts
    Member since:
    May 2008

    Posted 31 Dec 2008 Link to this post

    Hi, I found this and other threads on the topic to be very helpful, yet in my case everything in web.config was correct, which I verified three different ways, and I could not reduplicate the problem in a mini-site setting.  I encountered this problem upon upgrading from Q2 2008 (which worked fine) to Q3 2008 SP1. I eventually found my solution and would like to share it with others because it is....different.

    The error occured for me upon loading certain pages and actually prevented some controls from loading. 
    I use code obtained from the internet that protects against SQL Injection via QueryString.  Part of that code includes the following condition:

    - Throw an exception when the QueryString is greater than 500 characters in length.

    Somewhere in the Q3 2008 SP1 control suite, Telerik is using a QueryString (I think you are anyway!) that contains version numbers and public tokens like assembly references and of course this exceeds 500 characters.  So my application threw an exception which stopped page loading which caused the 'sys' is undefined the error.  Removing that condition from the algorithm made the site run correctly.

    So my advice would be to check for (hidden) exceptions in the Application_BeginRequest function of Global.asax, particularly where QueryString length is concerned :)   Because I found it on the internet, it's quite possible others have the same algorithm.
  25. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 31 Dec 2008 Link to this post

    Darlene-

    Thanks for sharing the extra info! That will definitely be helpful for those that follow. Here is some additional "insight" in to what was likely causing your problem:

    In ASPNET 2+, many resources (such as JavaScript files, CSS files, etc.) are loaded on the page using resources embedded in assemblies. The ASPNET AJAX framework and the Telerik RadControls use these so called "Embeded WebResources" extensively. When your page loads, if you inspect the source (using a tool like FireBug), you'll see many URLs on the page that look like this:

    /aspnet-ajax/ScriptResource.axd?d=OMRTld8zxf1PXEvrZ_TTz33mn_vqqY8Pa9ZNgHMZYVBWXyllo0iWwBvaeYOQ7S3CsjUbY0QwlOKwDk14_XLDmA2&amp;t=633632017290000000

    As you can see, the QueryString is used to pass values to a special HttpHandler (in this case, the ScriptResource.axd handler) that in turn returns the resource embeded in the assembly. These values can be pretty long, so I expect this was probably the source of your QueryString errors. That said, I'm not sure I've ever seen any web resource URLs longer than 500 characters, so maybe there is an extra issue related to your specific problem (such as a long site path or an extra value appended to your URLs, like SessionID).

    As a general note to your original problem (protecting against SQL Injection), there are number of solutions for protecting your site that don't require you to cap your QueryString length. You can do anything from simply using named and typed parameters in your .NET data access code to using a complete tool like Telerik OpenAccess ORM to better secure your database. Using paramters alone is generally enough to stop SQL Injection, though, so I think you're current approach may be overkill if you have safe code on your server. Here are some great articles that have quick guidance on preventing SQL Injection with ASPNET:


    Hope that helps!
    -Todd
  26. W
    W avatar
    2 posts
    Member since:
    Mar 2009

    Posted 27 Mar 2009 Link to this post

    My configuration involved Telerik RadAjax 2009Q1 on Server 2008 and IIS7 using an application pool set to Classic pipeline mode. The documentation here seems to ignore this configuration.

    At first, I was getting a 500 server error, however it was not an ASP.NET error, it was coming out of IIS (so there was no nice stack trace information of any kind). After some playing around, I was also getting the 404 error. Through trial and error, I was able to determine that the issue was caused by the handler configuration.

    This is the setting in system.webServer/handlers that was required:

    For a 32-bit installation:

     

    1 <add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" modules="IsapiModule" scriptProcessor="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" /> 

     

     

    For a 64-bit installation:

    1 <add name="Telerik.Web.UI.WebResource" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" /> 

    Hope this helps someone!
    Wes
  27. Divya Nair
    Divya Nair avatar
    1 posts
    Member since:
    Nov 2009

    Posted 08 Nov 2009 Link to this post

    Thanks Everyone....
    I have tried the code provided by Shaik n it's worked perfectly for me...

    Best Regards,
    Divya Nair
  28. Vishwanath
    Vishwanath avatar
    7 posts
    Member since:
    Sep 2007

    Posted 05 Feb 2011 Link to this post

    Here is my web.config

    Can someone Point out whats wrong . It seems ok to Me

    <?xml version="1.0" encoding="utf-8"?><configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
    <appSettings>
    <add key="DisplayDateLocaleName" value=""/>
    <!--<add key="ResourceFilesPath" value="D:\ABC\Inetpub\Resources\Globalization"/>-->
    <add key="ResourceFilesPath" value="D:\ABC\Inetpub\GlobalizationResources"/>

    </appSettings>
    <system.web>


    <pages>
    <controls>
    <add tagPrefix="radCln" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI.RadDatePicker"/>
    <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </controls>
    </pages>
    <httpModules>
    <add name="GlobalizationModule" type="ABC.HttpModules.GlobalizationModule, ABC.HttpModules.AccessControl, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fc0b46b2833ef0d3, processorArchitecture=MSIL"/>
    </httpModules>
        
    <compilation debug="true">
    <assemblies>
    <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.DirectoryServices.Protocols, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.EnterpriseServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.ServiceProcess, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Web.RegularExpressions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
    <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="ABC.Web.Controls, Version=1.0.0.0, Culture=neutral, PublicKeyToken=FC0B46B2833EF0D3"/>
    <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    </assemblies></compilation></system.web>

    </configuration>
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017