jeudi 2 juin 2016

Script not loading

Hi guys i am losing a lot of time on a problem that might be easy, and i bet it is a simple thing, so in the layout.cshtml i load all my scripts like this

<!DOCTYPE html>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - My ASP.NET Application</title>

    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("Home", "Index", "Home")</li>
                    <li>@Html.ActionLink("About", "About", "Home")</li>
                    <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
    <div class="container body-content">
        <hr />
            <p>&copy; @DateTime.Now.Year - My ASP.NET Application</p>

@RenderSection("scripts", required: false)
<script type="text/javascript" src="~/Scripts/bootstrap-filestyle.js"> </script>

the scripts that are in this page are loaded in the buldeconfig like this:

 public class BundleConfig
    // For more information on bundling, visit
    public static void RegisterBundles(BundleCollection bundles)
        bundles.Add(new ScriptBundle("~/bundles/jquery").Include(

        bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(

        bundles.Add(new ScriptBundle("~/bundles/UserScripts").Include(

        bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(

        bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(

        bundles.Add(new StyleBundle("~/Content/css").Include(

a strange thing is happening i jquery code on the CrowdTouring.cs that should be aplied for 2 pages, my register and my edituser, in the register it is working it disables a button, but in my EditUser it doesnt work and i dont know why i already tryed everything :S

Here is my Jquery CrodwTouring.js

$(document).ready(function () {
$("#checky").click(function () {
    $("#RegisterBut").attr("disabled", !this.checked);

$("#TipoUtilizador").change(function () {
    if ($(this).val() == "Cliente") {
        $("#TextoTipoUtilizador").text('Crie desafios de inovação turística e obtenha melhores soluções a um preço mais acessível e de melhor qualidade');
    if ($(this).val() == "Resolvedor") {
        $("#TextoTipoUtilizador").text('Crie Soluções para os desafios e obtenha uma grande variadade de prémios');
    if ($(this).val() == "Avaliador") {
        $("#TextoTipoUtilizador").text('Avalie as soluções e ganhe notoriedade na plataforma');

$("div.myclass").hover(function () {
    $(this).css("background-color", "red")

function readURL(input) {
    if (input.files && input.files[0]) {
        var reader = new FileReader();

        reader.onload = function (e) {


$("#ImagePath").change(function () {


Finally in my editUser page i load the scripts like that on the bottom

 <div class="form-group">
        <div class="col-md-offset-3 col-md-9">
            <input type="submit" value="Save" class="btn btn-default" />


    @Html.ActionLink("Back to List", "Index")

@section Scripts {

Aucun commentaire:

Enregistrer un commentaire