I have downloaded the TinyMCE.MVC.Jquery and TinyMCE.MVC.Jquery.Sample into a new MVC.NET 4 project, however I cannot seem to get it to show in the sample TinyMCESampleJQuery cshtml page.
I only changed the
content_css: "#Url.Content("~/Content/Site.css")",
to point to my stylesheet and added the jquery and tinymce references
<script src="#Url.Content("~/Scripts/tinymce/jquery.tinymce.js")" type="text/javascript"></script>
<script src="#Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script>
Do I need to do anything else to get it to work?
Ok so I tried something and this worked!
I removed the jquery link from my tinymce cshtml, and moved the jquery scripts bundle in the layout page to the and that worked
Are you referencing there stylesheet and have you added the required images into your project?
Related
I trying to study .net core with a test project.
In this project there is a user javascript javascript file called "booklist.js" that call some functions like edit and delete button.
For some strange think any modifications of this file don't do any effect.
After delete this file, the project continue to work.
But if i disable these lines:
#section Scripts{
<script src="~/js/bookList.js"></script>
}
on the view page the project not read the data.
I'am new with MVC and I don't have any idea about.
Can you help me please ?
Thanks !
One of the reasons of this issue could be browser caching the old js in file, as a solution is to append a parameter to your js source like a timestamp
Then your js tag becomes:
<script type="text/javascript" language="javascript">
var versionUpdate = (new Date()).getTime();
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "~/js/bookList.js?v=" + versionUpdate;
document.body.appendChild(script);
</script>
Reference: https://www.c-sharpcorner.com/article/how-to-force-the-browser-to-reload-cached-js-css-files-to-reflect-latest-chan/
or
You can use the new feature in .Net Core
asp-append-version="true"
Then your js tag becomes:
<script src="~/js/bookList.js" asp-append-version="true"></script>
Reference: https://www.c-sharpcorner.com/blogs/aspappendversion-feature-in-asp-net-core
Here is where i include the ScriptBundle:
bundles.Add(new ScriptBundle("~/scripts").Include(
"~/Scripts/jquery.js", "~/Scripts/popper.js",
"~/Scripts/bootstrap.js", "~/Scripts/Index.js"));
When i debbug the application the script tags are rendered separately, and it works well. The problem is when i publish the project, the scripts are rendered in a single tag; i know that AspNet compress all the scripts in a single tag, but the web page does not detect the scripts and when i click on the link of the rendered tag, it directs me to a source code page (HTML) in which the scripts should be.
This is the tag:
<script src="/scripts?v=r8NL2JoYrRk4WG4L8aUu1037yymdncGQgFxOAcbEyw41"></script>
And this is the link: script_tag_link
Here is how the page of the link looks:
Here should be the compressed scripts
The ScriptBundle name, in this case "~/scripts", shouldn't match an existing folder in your application. Try changing it to "~/bundles".
Jquery datepicker is working in normal webpage but not with master page concept.It's throwing error saying "0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'datepicker'".
Tried following approaches but no luck.
1st Approach:
$('#<%= datepicker.ClientID %>').datepicker();
2nd Approach:
$(".datepicker").datepicker();
3rd Approach:
Placed jquery script files in master page and datepicker code between script tag inside content placeholder like below
<script type="text/javascript">
$('#<%= datepicker.ClientID %>').datepicker();
</script>
Please suggest other approaches to make it work.
I'm trying to port THIS pasge and its HTML5 animation to a winform.
What I did is copied and added the index.html and all the css and js file to my project. This is how my project directory looks like
And then I'm trying to load the html file into my webbrowser object using this code snippet
private void Form1_Load(object sender, EventArgs e)
{
string curDir = Directory.GetCurrentDirectory();
this.webBrowser2.Url = new Uri(String.Format("file:///{0}/index.html", curDir));
}
And I have set properties of all the file to Copy Always
Now when I run the project I get a script error message and upon pressing Yes
it loads the page but only background is displayed and the animation is lost!
please help!
PS: I've changed
<link href="css/main.css" rel="stylesheet" type="text/css" />
<script src="js/ThreeWebGL.js"></script>
<script src="js/ThreeExtras.js"></script>
To
<link href="main.css" rel="stylesheet" type="text/css" />
<script src="ThreeWebGL.js"></script>
<script src="ThreeExtras.js"></script>
in index.html file
Screenshots of two script error that I'm getting--
It works in IE10
The *.js files need to be in a js folder. Either create the folder and move them or edit the html file.
EDIT1:
Does it work if you point it to "http://www.script-tutorials.com/demos/177/index.html"?
EDIT2:
Add:
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
in the html head section.
EDIT3:
I tried on my machine and it's the same behavior. But the page does run fine in Internet Explorer 11. Maybe the WinForms control uses IE engine in some compatibility mode.
I would use http://www.awesomium.com/
The webbrowser control is just an instance of IE - that page doesn't work for me in Internet Explorer so it's unlikely to work in the embedded browser. Search for webkit net - might give you better results. I'm tempted to ask why you want to do this but I'm sure you've got a good reason.
Got it working! Basically the set up works fine. Just had to open main.css file and comment out all the footer properties to get rid of the footer and found another script ref which was pointed to js/script.js had to change it to script.js
Now how can i increase the framerate so that it doesnt stutter? Theres a lag at the moment
I'm doing a site using MVC 4. It's a site that list musics and the user can create a playlist (like a cart shopping).
I have for every music this action link that should be executed in Ajax:
#Ajax.ActionLink("Adicionar à Playlist","AddPlaylist", new { id = item.MusicaID }, new AjaxOptions {UpdateTargetId="playlist", InsertionMode=InsertionMode.Replace})
The action method from the controller returns a PartialView (the cart of playlist) and only that should update but instead of getting the whole page with that part updated I get a partial view and nothing more on the page.
This is the part where I render the PartialView:
<section id="playlist">
#Html.Partial("_PlaylistPartial")
</section>
Shouldn't this work like I have?
Make sure you have included
<script src="#Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
in your view
It was a stupid thing.
First my include of jquery.unobtrusive-ajax.min.js didn't work like I have:
<script src="#Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
So I put like this:
#Scripts.Render("~/Scripts/jquery.unobtrusive-ajax.min.js")
And still wasn't working, because I also need to include the JQuery files:
#Scripts.Render("~/Scripts/jquery-1.7.1.js")
#Scripts.Render("~/Scripts/jquery.1.7.2.min.js")
This way it works :)
A little late to the party but I just had a similar problem. The solution was to add this line to _Layout.cshtml:
#Scripts.Render("~/bundles/jqueryval")
First, install Microsoft.JQuery.Unobtrusive.Ajax from NuGet Manager and later include ~/Scripts/jquery.unobtrusive in BundleConfig after including jquery-{version}.js; which will look something similar to this:
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js",
"~/Scripts/jquery.unobtrusive*));