javascript - jQuery code not working when called from aspx file with a master file -
i have created blank asp.net forms website. have taken default.aspx page , replaced default code code
https://blueimp.github.io/jquery-file-upload/jquery-ui.html
so looks
<%@ page title="home page" language="c#" masterpagefile="~/site.master" autoeventwireup="true" codefile="default.aspx.cs" inherits="_default" %> <asp:content id="bodycontent" contentplaceholderid="maincontent" runat="server"> html / javascript link above. </asp:content> if strip out master file content , paste content of page works perfectly. reason
when click add files , browse files not show on page, when have no master file stuff show fine.
i understand isnt great debug information. if knows way cold debug great.
if guess appears following code cause of error.
<script id="template-upload" type="text/x-tmpl"> {% (var i=0, file; file=o.files[i]; i++) { %} {% console.log(file.name); %} <tr class="template-upload fade"> <td> <span class="preview"></span> </td> <td> <p class="name">{%=file.name%}</p> <strong class="error"></strong> </td> <td> <p class="size">processing...</p> <div class="progress"></div> </td> <td> {% if (!i && !o.options.autoupload) { %} <button class="start" disabled>start</button> {% } %} {% if (!i) { %} <button class="cancel">cancel</button> {% } %} </td> </tr> {% } %} </script> when have @ html through browser following form missing page when load master file
<form id="fileupload" action="sendfiles" method="post" enctype="multipart/form-data">
when dealing aspx never use raw html id's in javascript, need real id via,
<script> var controlid = '<%= this.somecontrol.clientid %>' var things = $(controlid); </script> the <%=... %> logic aspx expression, server side aspx engine see , convert asking when spits out response.
Comments
Post a Comment