nikkishri / dropthings

Automatically exported from code.google.com/p/dropthings
0 stars 0 forks source link

asp:Button postback in .ascx.cs widget causes JavaScript errors. Error: 'DropthingsUI' is undefined. MyFramework.js is not loaded. #213

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. asp:Button click event in .ascx widget 

What is the expected output? What do you see instead?
On postback after button click, I see javaScript errors:   'DropthingsUI' is 
undefined.  MyFramework.js is not loaded.
Widgets no longer function after closing JavaScript popup error.

What version of the product are you using? On what operating system?
Dropthings 2.7.5   VS2010

Please provide any additional information below.
In my button click event... do I need to re-initialize something?

Original issue reported on code.google.com by bmi...@simonmed.com on 21 Jun 2011 at 9:28

GoogleCodeExporter commented 9 years ago
That's a surprise. Can you try reproducing it on dropthings.omaralzabir.com?

If you go to the second tab, there are buttons that produce server side 
postback.

Original comment by omaralzabir@gmail.com on 24 Jun 2011 at 10:08

GoogleCodeExporter commented 9 years ago
Yes, I went to http://dropthings.omaralzabir.com  and clicked on the second 
tab.  Then I clicked on the buttons which produce server side postbacks.  No 
issues.

Is there some code from one of these widgets which I need to add to avoid the 
issues reported at the top of this message thread?

Original comment by bmi...@simonmed.com on 28 Jun 2011 at 5:30

GoogleCodeExporter commented 9 years ago
I need to be more specific.  I am trying to add an asp:Button click event from 
the Header.ascx.  This is were I am experiencing the following errors.

'DropthingsUI' is undefined.  MyFramework.js is not loaded.
Widgets no longer function after closing JavaScript popup error.

What do I need to add to the Header.ascx in order to not experience these 
JavaScript errors?

Original comment by bmi...@simonmed.com on 28 Jun 2011 at 7:15

GoogleCodeExporter commented 9 years ago
Upon further testing... I added a test asp:Button in the Default.aspx.  
Clicking this button also causes the following errors.

'DropthingsUI' is undefined.  MyFramework.js is not loaded.

Widgets no longer function after closing JavaScript popup error.

Original comment by bmi...@simonmed.com on 29 Jun 2011 at 3:57

GoogleCodeExporter commented 9 years ago
asp:Button postback test works from inside test widget .ascx control.  However, 
button postback from OUTSIDE widget .ascx control throws JavaScript errors.  
'DropthingsUI' is undefined.  MyFramework.js is not loaded.

Help please?

Original comment by bmi...@simonmed.com on 29 Jun 2011 at 5:27

GoogleCodeExporter commented 9 years ago
i was getting this weird error. the found that scriptmanager injecting 
javascripts incorrectly due to virtual directory. updated as following and now 
works fine.

<asp:ScriptManager ID="ScriptManager1" runat="server" 
EnablePartialRendering="true" ScriptMode="Release">
    <Services>
        <asp:ServiceReference InlineScript="false" Path="~/API/Proxy.svc/ajax" />
        <asp:ServiceReference InlineScript="false" Path="~/API/Widget.svc/ajax" />
        <asp:ServiceReference InlineScript="false" Path="~/API/Page.svc/ajax" />
    </Services>
    <Scripts>
<asp:ScriptReference 
Path="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" />
        <asp:ScriptReference Path="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" />
<%--        <asp:ScriptReference Path="/Scripts/jquery-1.3.2.min.js" />
        <asp:ScriptReference Path="/Scripts/jquery-ui.1.7.1.custom.min.js" />
--%>        <asp:ScriptReference Path="~/Scripts/jquery.micro_template.js" />
        <asp:ScriptReference Path="~/Scripts/tabscroll.js" />
        <asp:ScriptReference Path="~/Scripts/Myframework.js" />
        <asp:ScriptReference Path="~/Scripts/Ensure.js" />        
    </Scripts>    
</asp:ScriptManager>

sanjaya kumar

Original comment by srisa...@gmail.com on 9 Sep 2011 at 7:57

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Scratch my previous comment.. I reported a separate issue for that (which on 
closer inspection, appears to be unrelated). However, to chime in on this one, 
I do not think the proper solution is to include external .js files. Shouldn't 
cross-site scripting be avoided, when possible? This seems like a workaround 
for whatever virtual directory issue was being seen, rather than a solution. 
Keeping jQuery files in the Scripts folder maintains the version that is known 
to be compatible (should a newer version not be backwards compatible in some 
respect).

Original comment by craig.em...@gmail.com on 21 Nov 2011 at 7:30

GoogleCodeExporter commented 9 years ago

Original comment by omaralzabir@gmail.com on 22 Mar 2012 at 1:57

GoogleCodeExporter commented 9 years ago
Not sure if this is the same problem.

Put this script in a widget to produce 'DropthingsUI' is undefined error

<script type="text/jscript">
function timedRefresh(timeoutPeriod) { 
setTimeout("__doPostBack('WidgetBodyUpdatePanel', '');", 10000);} 
timedRefresh();
</script>

Original comment by war...@warrent.co.nz on 5 Apr 2012 at 12:39