This is a migrated thread and some comments may be shown as answers.

Javascript Error in Upload Avatar Example

5 Answers 135 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 03 Oct 2011, 11:00 PM
I created a page that uses the "Upload Avatar" example exactly, and when I run it in IE 9 I get the following error:

"Unable to get value of the property 'ajaxRequest': object is null or undefined"

Has anyone seen this?

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
</telerik:RadScriptManager
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Thumbnail" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<script type="text/javascript">
    function fileUploaded(sender, args) {
        $find('RadAjaxManager1').ajaxRequest();
        $telerik.$(".invalid").html("");
        setTimeout(function() {
            sender.deleteFileInputAt(0);
        }, 10);
    }
 
    function validationFailed(sender, args) {
        $telerik.$(".invalid")
            .html("Invalid extension, please choose an image file");
        sender.deleteFileInputAt(0);
    }
</script
 
 
            <telerik:RadBinaryImage runat="server" Width="200px" Height="150px" ResizeMode="Fit"
                ID="Thumbnail" ImageUrl="blank.png" AlternateText="Thumbnail" CssClass="binary-image" />
 
 
            <span class="invalid"></span>
            <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" MaxFileInputsCount="1" OnClientFileUploaded="fileUploaded"
                OnFileUploaded="AsyncUpload1_FileUploaded" AllowedFileExtensions="jpeg,jpg,gif,png,bmp" OnClientValidationFailed="validationFailed">
                <Localization Select="Upload Logo" />
            </telerik:RadAsyncUpload>

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Oct 2011, 06:50 AM
Hello Dean,

I am not sure which version of the Telerik controls that you are using. IE 9, FireFox 4 and Google Chrome10 are supported by controls starting Q1 2011. If you would like to ensure that our AJAX controls are compatible with the new major versions of these three browsers, you will need to migrate at least to version 2011.1.315. With older versions these browsers are only partially supported.

Updating RadControls for ASP.NET AJAX to another version or license.

Thanks,
Shinu.
0
Dean
Top achievements
Rank 1
answered on 04 Oct 2011, 02:44 PM
I verified that we are using the latest version.
0
Dean
Top achievements
Rank 1
answered on 04 Oct 2011, 02:48 PM
FYI,

It seems like it may only be an issue when running in debug mode.  If I run the page from with Visual Studio, I get the error when I select a file to upload.  But if I copy the URL and paste it into another browser window (IE or Chrome), it seems to work.  I'll see if I can get the project compiled and put on a web server and run some tests.
0
Dimitar Terziev
Telerik team
answered on 06 Oct 2011, 10:56 AM
Hello Dean,

The code that you are using seems fine, so test it when deployed and let me know of the results.

Best wishes,
Dimitar Terziev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Suwitcha
Top achievements
Rank 1
answered on 26 Feb 2012, 06:30 PM
I think you may have met this problem when you put your code in a Master page. So that the $find() can't find the RadAjaxManager control, then the result of calling the method is 'object is null or undefined'

try this $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest(); and you may succeed. :)

Tags
AsyncUpload
Asked by
Dean
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Dean
Top achievements
Rank 1
Dimitar Terziev
Telerik team
Suwitcha
Top achievements
Rank 1
Share this question
or