<%@ Page Language="C#" AutoEventWireup="true" CodeFile="up1.aspx.cs" Inherits="up1" %>
<%@ Register assembly="Infragistics4.Web.jQuery.v12.1, Version=12.1.20121.2236, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" namespace="Infragistics.Web.UI.EditorControls" tagprefix="ig" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <link type="text/css" href="~/ig_ui/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" /> <link type="text/css" href="~/ig_ui/css/structure/infragistics.css" rel="stylesheet" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script> <script type="text/javascript" src="~/ig_ui/js/infragistics.js"></script> <script type="text/javascript" language="javascript"> $(function () { $("#upload").igUpload({ mode: "single", autostartupload: true, // to upload a file, you need a server-side handler progressUrl: "IGUploadStatusHandler.ashx", controlId: "serverID" }); }); </script>
<script type="text/javascript" language="javascript"> function onErrorHandler(e, args) { var message = "ErrorCode" + ": " + args.errorCode + "<br />" + "ErrorMessage" + ": " + args.errorMessage + "<br />" + "ErrorType " + ": " + args.errorType + "<br />" + "ServerMessage" + ": " + args.serverMessage;
alert(message);
} </script></head><body> <form id="form1" runat="server"> <div id="upload"> <ig:WebUpload ID="WebUpload1" runat="server" Mode="Single" AutoStartUpload="true"> <ClientEvents OnError="onErrorHandler" /> </ig:WebUpload> </div> </form></body></html>
Hello Lee MH,
Thank you for posting in our community.
What I noticed from the sample project provided is that you are trying to reference a script that is not actually present in the directory from the path used to reference it. This is the jQuery.tmpl.js file .
Additionally, I noticed that the path used for referencing Infragistics.js script where all necessary scripts for the igUpload are located, is not correct. This means that script for the Uploader are not loaded ant this is the reason for the exception thrown in your browser. What I can suggest is using the following path for the Infragistics.js script:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script> <%--<script type="text/javascript" src="~/ig_ui/js/jquery.tmpl.js"></script> --%> <script type="text/javascript" src="ig_ui/js/infragistics.js"></script> <%--<script type="text/javascript" src="~/ig_ui/js/infragistics.js"></script>--%> <link type="text/css" href="~/ig_ui/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" /> <link type="text/css" href="~/ig_ui/css/structure/infragistics.css" rel="stylesheet" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"></script>
<%--<script type="text/javascript" src="~/ig_ui/js/jquery.tmpl.js"></script> --%>
<script type="text/javascript" src="ig_ui/js/infragistics.js"></script>
<%--<script type="text/javascript" src="~/ig_ui/js/infragistics.js"></script>--%>
<link type="text/css" href="~/ig_ui/css/themes/infragistics/infragistics.theme.css" rel="stylesheet" />
<link type="text/css" href="~/ig_ui/css/structure/infragistics.css" rel="stylesheet" />
I hope this helps you resolve your issue.
Please let me know if you need any further assistance with this matter.
Hi, Vasya
I confusied url syntax in javascript and asp.net .
I am resolving file upload by your answers.
Thank you very much. Good Night.
Hello Lee MyoungHwan,
I am glad that you have been able to resolve you issue.
Please let me know if you have any additional questions regarding this matter.