Showing posts with label greetings. Show all posts
Showing posts with label greetings. Show all posts

Wednesday, March 28, 2012

changes to adding ScriptReference?

Greetings! I have a javascript file that does some rounded corners on my page called rounded.js. In Beta1 I declared it like this

<asp:ScriptManager ID="ScriptManager1" runat="server"> <Scripts> <asp:ScriptReference Path="~\rounded.js" /> </Scripts></asp:ScriptManager>

This is inside my Master Page. After the content place holders, at the end of the master page I have this.

<script type="text/javascript"> Rounded('header',6,6); Rounded('navigation',6,6); Rounded('content',10,10); Rounded('navigationright',6,6); Rounded('footer', 6, 6); </script>

It worked great with Beta1 but doesn't in Beta2. There are no rounded corners, and the javascript error reads:

Sys.ScriptLoadFailedException: The script 'rounded.js' could not be loaded or does not contain the Sys.Application.notifyScriptLoaded() callback.

Now, if I navigate with the back and forward buttons to pages inside my app, I still get the error, but the script does load somehow, because the rounded corners are there.

Please help!

Check out the release notes for the ASP.NET AJAX Extenstions (C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025\ReleaseNotes.txt)...

Under "4.3: Client Framework" you will see some notes about "* Script loading improvements". Relevant to your situation: "Component developers and page developers creating file-based script libraries that are registered with the ScriptManager control should include a JavaScript code snippet that indicates that the library has been downloaded by the client. Although this is not required in all browsers, Safari requires this to be able to dynamically load scripts."

Try adding this line to the very end of your 'rounded.js' file:

if(typeof(Sys) !='undefined') Sys.Application.notifyScriptLoaded();

Thanks,
Kyle


Is the CTP libraries also need this change?

I use this code to reference CTP libraries:

1<asp:ScriptManager ID="ScriptManager1" runat="server" >2<Scripts>3<asp:ScriptReference Path="~/PreviewDragDrop.js" />4<asp:ScriptReference Path="~/PreviewGlitz.js" />5<asp:ScriptReference Path="~/PreviewScript.js" />6</Scripts>7</asp:ScriptManager>
is it right? I copied these files to my site's root directory.
and I also got the "script could not loaded" exception while running...

hello.

well, i think the value added bits don't notify the sys.application object on completion of the load. so, you can add that line to the files or you can add them to the page through the <script> element.


hey all

im having the same problem now ive upgraded :-(

The solution was to add the following line:

if(typeof(Sys) !='undefined') Sys.Application.notifyScriptLoaded();

Im still getting the same error being thrown though :-( My JS file looks like this:

function

test()
{
alert("function called");
}
if(typeof(Sys) !='undefined') Sys.Application.notifyScriptLoaded();

and i call the script like this:

<

Scripts>
<asp:ScriptReferencePath="JScipt.js"/>
</Scripts>

What am i doing wrong??

Cheers Will


hello,

make sure IE is not caching the js file.


hey - thanks for the quick reply!

Yeh i just tried clearing out all the IE cache, but its still moaning :-(

What else could i be doing wrong?


hello.try debugging the page and make sure that the call to notifyscriptloaded is being made.

ok im getting somewhere!

i tried changing the script path on my test project to an absolute path

before: Path="JScript.js"

after: Path="http://localhost:2303/AjaxControlToolkitWebSite1/JScript2.js"

all works fine! this is not summet i want to do, so why is not looking in the wrong place?

Cheers for ya help dude

Will


hello.

i've been having some problems with the internal server, ie, i'm having several issues with the caching of files when i use the internal server.


I am having the exact same problem with the internal server caching files...did you figure out a good work around?

Thanks, Greg Benoit


hello.

wll, not really. i've started using IIS :)


What are the steps for converting an existing file based project to using IIS?? I tried and almost got it working, but when I went to login using my login control and the aspnetdb the login control reported back that my login credentials were incorrect??

Thanks, Greg

Monday, March 26, 2012

CascadingDropDowns cant fire OnSelectedIndexChanged client events?

Greetings, all...

I've got a page with a CascadingDropDown setup. On the third dropdown, I want to fire an update panel event to fetch data.

For whatever reason, it does not appear that I can get any of the three dropdowns in the cascade to recognize a client-side OnSelectedIndexChanged event - even when added programmatically in the code file.

The event/action are emitted correctly to the control, but it doesn't seem to fire the event.

I've been trying to find the answer in previous posts and Google, but I don't seem to be finding the answers anywhere. I'm hoping there's someone out in forumland that has seen this before and knows how to resolve the issue.

Thanks in advance for the help,

Ric Castagna

Unless I'm mistaken, OnSelectedIndexChanged is a server-side event, not a client-side one.

Saturday, March 24, 2012

CascadingDropDown, FormView, ObjectDataSource, Optimistic Concurrency and Delete

Greetings,


We have recently upgraded a web site from "atlas" July 06 to use AJAX 1.0 (1.0.61025.0) and AjaxControlToolkit March 07 (1.0.10301.0). As you can imagine, we had to "tweak" a fair amount of code but in short, all is now working minus one major point.


We have a middle-tier DataAccessLayer that simply uses Microsoft's XSD's to connect to Oracle 9i and we make use of the Optimistic Concurrency feature. The front-end web with FormViews and Cascading dropdowns consumes the ObjectDataSource and works great on Insert and Update. But Deletes fail due to optimistic concurrency. It seems that only on deletes, the "Original_fieldname" values are NULL for any dropdown wired to a cascading control. However, "Original_fieldname" values are correct when UPDATE is clicked. Only when DELETE is clicked does the FormView fail to populate to original values and thereby the ObjectDataSource has NULL values as well.


Any ideas? Thanks!

Unfortunately, use of the CascadingDropDown isn't fully compatible with standard data-bound drop downs. The CascasdingDropDown expects to pick up it's data from the async web service call.

Off the top of my head, I'm not sure how those field values get populated, but I suspect it's part of the <%# Bind() %> functionality. The CascadingDropDown might be overwriting those values. You might be able to work around this by trapping the delete and filling in the value before the command is sent to the ObjectDataSource.


Thanks for the info. We used your suggestion in the ObjectDataSource_Deleting event and supplied all of the "original_xxx" InputParameters with values from a lookup to the record in question. Kind of a hack and somewhat defeats the purpose of optimistic concurrency, but it will do for now. Aside from that, the work your team has done on the toolkit is amazing. Keep it up!

Wednesday, March 21, 2012

CascadingDropDown load times with large amounts of data

Greetings,

I am a relative newcomer to ASP.Net AJAX. So hopefully the answer to this question will be quick and easy.

I've created a CascadingDropDown list that gets store locations based on the company. In some of these datasets there are as many as 6,000 - 10,000 records that need to be loaded into the TargetControl. This ends up being quite a lot of data. I was having problems with this origanally because of the default maxJsonLength in my webconfig which I've now corrected.

The TargetControl now gets loaded and it works with this one exception: For queries with exceptionally large datasets the client is taking up to 30 seconds or more to load the target control. I did caching on the server side in the webservice to cache data sets and that doesn't seem to be the problem. I've done some analysis with Fiddler v2.0 and it appears that the round trip request/response is taking only about a 5th of a second (see capture below):

Request Count: 1
Bytes Sent: 545
Bytes Received: 701,964

ACTUAL PERFORMANCE
-----
Requests started at: 13:58:38:1621
Responses completed at: 13:58:38:3496
Total Sequence time: 00:00:00.1875024

RESPONSE CODES
-----
HTTP/200: 1

RESPONSE BYTES (by Content-Type)
-----
~headers: 239
application/json: 701,725

So the question is: why does it take the CascadeDropDown control so long to load the data? What is client doing for the other 29.8124976 seconds?

When I did this web app in ASP.Net 2.0 (without AJAX), it was taking 2- 3 seconds max for these large data sets to load doing direct databasecalls.

Any help would be appreciated.

Thanks,

Scott Lance
Application Developer
Children's Miracle Network

I have the same problem in my application. Large sets of data are not uncommon in the large applications.

Can anybody, please, take a look at this