Pergunta

I am trying to call the jquery uploadify functions from my aspx page. I get this exception when the page loads and $(document).ready is called. It seems that for some reason the FileUpload1 control is not able to call the uploadify function, but I can't tell why. Does this have to do with the control not being in the master page?

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="useredit.aspx.cs" Inherits="Dashboard.UserEdit" 
MasterPageFile="~/Masters/Dashboard.master" Title="Profile: Edit " %>

<asp:Content ID="ctHead" ContentPlaceHolderID="cphHead" runat="server">
<link rel="stylesheet" type="text/css" href="/stylesheets/uploadify.css" />
 <style type="text/css">
    .FileUpload1
     {
       font-size:11px;
       color:#5B5B5B;
     }
 </style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js" > </script>
<script language="javascript" type="text/javascript" src='<%# ResolveUrl("~/inc/jquery.uploadify.js") %>' ></script>
<script type="text/javascript">
$(document).ready(function() {
    $('.FileUpload1').uploadify({
        'swf': 'uploadify.swf',
        'uploader': 'TNTUpload.ashx',
        'auto': true,
        'multi': true
    });
});
</script>
</asp:Content>

...

<asp:Content ID="ctBody" ContentPlaceHolderID="cphBody" runat="server">
    <div style = "padding:40px">
        <asp:FileUpload ID="FileUpload1" runat="server"/>
    </div>
</asp:Content>
Foi útil?

Solução

The problem here seems to have been caused by already existing jquery scripts in the master page. After I moved the jquery script out of my aspx page and onto the master page the "Object doesn't support property or method..." error went away. I am now having new problems with uploadify having to do with SWF and/or IE, but at least this headache has been resolved.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top