DateTimePicker Azure Implemetation Error - asp.net-mvc

Hey there I' after publishing my project to azure I have used data comparison to transfer my database to the online server database but now My DateTimePicker does not work it now displayes in the top left corner and does not input data at all. When i ran the project again on the localversion it worked fine?
I found the followig errors in the console.
This has me fairly stumped. Has anyone seen anything like this before.
Azure View
Localhost View
Bundles file
file structure

As from the comments, the issue seemed to be originating from the scripts being included in an incorrect manner by the Bundle.
Trying with individual <Script src=""> tags explicitly will give you more control on the order of the scripts. And in this case seems to be solving the problem.
You can additionally also try splitting the js bundle into multiple bundles and try to add in order. Then check in the browser source if the ordering and result are appropriate even with the bundles. You can check the <script> tags generated by bundles and compare with your manual script tags, which work, and then alter the bundles.

Related

Purpose of some of the JavaScript files in an ASP.NET MVC project under the Scripts folder

I always see these few files under the Scripts directory:
ai.0.22.9-buildXXXXX.js
ai.0.22.9-buildXXXXX.min.js
jquery-[version #].min.map
According to this answer, I can wipe out the Scripts folder. But I usually leave these 3 files alone, because I am afraid of bad consequences.
So What are the purposes of each file?
Microsoft Application Insights JavaScript SDK
Application Insights tells you about your app's performance and usage.
By adding a few lines of code to your web pages, you get data about
how many users you have, which pages are most popular, how fast pages
load, whether they throw exceptions, and more. And you can add code to
track more detailed user activity. ai.0.22.9-buildXXXXX.min.js can be
removed if you dont need to view site statics
For more details on how to use it
jquery-[version #].min.map
It is used for Source Mapping
Consider when you start debugging and you are on the particular line.
And you press (F11 or Click Step into Next Function Call), the
debugger tool will take you to jquery.min.js. And looking at jquery
minified version, it is impossible to find out the error. But with
source maps, you can let the browser’s debugger "map" the lines in the
compressed file into the uncompressed source. For Source map to work
successfully, two things are required.
1. Value of sourceMappingURL exists on your server or locally.
2. Browser Support
For further details
if you don't need it you can remove it
ai.*.js files are for Application Insights. Not required and can be removed, unless if using Application Insights.
*.map are for debugging purposes of JavaScript files. I doubt it will be necessary to debug the jQuery plugin. Not required and can be removed.

Why can't I view or edit Umbraco templates?

When I open the Umbraco (7.6.3) backoffice, I'm unable to view or make changes to templates. It seems like other functionality is unaffected, and I can create & edit specific pages. However, attempting to open the templates themselves just leads to a white screen. This problem exists across browsers:
Other screens render just fine:
What gives?
Checking the console when attempting to load gives an interesting error:
Error: Argument 'Umbraco.Editors.Templates.EditController' is not a function, got undefined...
Resolution:
The issue seemed to be caused by outdated files in the Umbraco folder. Copying most directories over from packages\UmbracoCms.7.6.3\UmbracoFiles\umbraco\ seems to have done the trick.
Looking at the changelog, it seems like the JS folder was the most influential in getting this fixed.
Are you sure that you're on 7.6.3? The UI appears to be pre-7.6 (I can tell because the colours haven't been updated).
If you have just upgraded, it's possible that your browser has cached the JS which is used - hard refresh your browser to see if the UI updates.
Umbraco also uses a dependency service to compile all of the used JS/CSS files together into one large one. This service will not be used if your website is in debug mode. Either:
Turn debug mode on in the Web.config
Delete any files in the \App_Data\ClientDependency\ folder as this is where the cached compiled files are kept (these will be regenerated)
My first thought would be file permissions.
Have you run the health check for permissions in the developer section? Need to make sure that your application pool user has write permissions on the Views folder.

neod3.js usage to visualize neo4j data on a seperate website

Im trying to use the standard neo4j visualisation in a seperate Website (not the original Neo4j Webbrowser). Therefore I downloaded the library from here:
https://github.com/neo4j/neo4j/tree/master/community/browser/lib/visualization
I really struggle with using it. I actually have no real idea. I tried including it into a html file but hardly failed.
Did anyone do this? Would be very nice, if someone could help me out.
Thanks a lot!
Greetings
Schakron
Those are all coffee files (coffeescript, which compiles into javascript). It looks like if you go up two levels there's a README which shows you how to start it up using npm and grunt:
https://github.com/neo4j/neo4j/tree/master/community/browser
The app itself (maybe it's a node.js app, though I don't see references to node) is under the app directory from there. It has jade files which would be the HTML views (jade compiles to HTML similar to how coffescript compiles to javascript).
So presumably if you get that all set up there will be a server serving up HTML which will compile and serve up those coffeescript files as javascript in the page

Is there a way to update asp.net mvc bundle contents dynamically at run-time?

I'm ASP.NET MVC v4 for my application, and I'm using the web optimization features (bundling and minification of scripts and styles).
Now, what I understand is (please correct me if wrong), the optimization framework will look at the included files at the time of compilation and configure them. It'll create a version number (v=something) based on the contents. Every time the contents change, it'll recreate the version hash, and the client will get updated files.
Now, is there a way to get the following done
[1] Update something inside a js file in my server, and serve the updated one to the clients without re-building & re-starting the application (I'm not changing bundle configuration here, just updating file content inside a script) ?
[2] Update the script configuration itself (e.g. adding a new script to a bundle), and get that served to the clients without Re-compiling & Re-staring the application? Or, at least without re-compiling? (I know, generally we define the bundles inside cs files, but wondering if there is a way out!)
[3] Is there a way to use my own version number (say from a config file, v=myCustomScriptVersion) rather than the auto-generated version hash?
It's bit late, but I'm just sharing my experience on my own questions here.
As discussed in the comments of the question, bundles are defined as part of a cs file (generally BundleConfig.cs inside App_Start). So, the bundles are defined at compile time, and at application start they will get added to collection and become usable.
Now, the interesting bit. At run-time, the optimization framework looks into the included files and creates a hash of the contents, and appends that as a version query-string to the bundle request. So, when the bundle is called the generated uri is like the below one.
http://example.com/Bundles/MyBundledScripts?v=ILpm9GTTPShzteCf85dcR4x0msPpku-QRNlggE42QN81
This version number v=... is completely dynamic. If any file content within the bundle is changed, this version will be regenerated, and will remain same otherwise.
Now to answer the questions,
[1] This is done automatically by the framework, no need to do anything extra for this. Every time a file content is changed, new version number will be generated and the clients will get the updated scripts.
[2] Not possible. If files included in a bundle are changed, is has to be recompiled.
[3] Yes, it can be used. The custom version number can be added as below.
#Scripts.Render("~/Bundles/MyBundledScripts?v=" + ConfigurationManager.AppSettings["ScriptVersion"])
But Caution! This will remove the automatic versioning based on file contents.
And, additionally, if there are multiple versions of the same file available and we always want to include the latest version available, that can be achieved easily by including a {version} wildcard in bundle configuration like below.
bundles.Add(new ScriptBundle("~/Bundles/MyBundledScripts")
.Include(
"~/Scripts/Vendor/someScript-{version}.js"
));
So, if there are 2 scripts in the /Scripts/Vendor folder
someScript-2.3.js
someScript-3.4.js
Then the file someScript-3.4.js (higher version) will get included automatically. And when a new file someScript-4.0.js is added to the folder, that will be served to clients without any need for recompile/restart.

OpenLayers that is not minified?

I'm trying to find an OpenLayers3.js file that is not minifed, it is a pain debugging stuff that is minified, can anyone help me find it?
Im using this address now: http://openlayers.org/en/v3.0.0/build/ol.js
By the way, it is a special thingy at the top. See the website: http://ol3.js.org/ ? Made me laugh.
Help?
If you need the unminified ol, you can use the one from ol:
http://openlayers.org/en/v3.0.0/build/ol-debug.js
It's a file of 3.5M so don't use this in production ;)
Have you tried the Download link on the main page?
https://github.com/openlayers/ol3/releases/download/v3.0.0/v3.0.0.zip
If you want a hosted version, upload one here:
https://cdnjs.com
Yes, http://openlayers.org/en/v3.0.0/examples/loader.js will load all the raw files -- basically by writing out a bunch of script tags. As #lexicore has already said, you can get the source from github, though this involves setting up nodejs locally to run (which actually isn't that painful, but more so than just debugging from a hosted source). Take a look at package.json to get a feel for how much has gone into OpenLayers 3.
If you go to the OpenLayers 3 examples, for example animation, change production to development in the drop down, and then do view source, you will get the link above. You can also see all the raw js files in the Javascript console.
EDIT: I put some instructions, following the official OL dev page, on how to build/run locally, which will also get you the unminified OL source code

Resources