Example #1
0
        protected void Application_Start(object sender, EventArgs e)
        {
            ScriptResourceDefinition mySRD = new ScriptResourceDefinition();

            mySRD.Path = "http://code.jquery.com/jquery-3.4.1.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", mySRD);
        }
Example #2
0
        protected void Application_Start()
        {
            //WebApiConfig.Register(GlobalConfiguration.Configuration);
            GlobalConfiguration.Configure(WebApiConfig.Register);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            //BundleConfig.RegisterBundles(BundleTable.Bundles);
            AuthConfig.RegisterAuth();
            var myScriptResDef = new ScriptResourceDefinition();

            myScriptResDef.Path      = "~/Scripts/jquery-2.0.3.min.js";
            myScriptResDef.DebugPath = "~/Scripts/jquery-2.0.3.min.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);
            var config = GlobalConfiguration.Configuration;

            config.Formatters.Insert(0, new JsonMediaTypeFormatter());
            FormatterConfig.RegisterFormatters(GlobalConfiguration.Configuration.Formatters);
            //HttpConfiguration.EnsureInitialized();
            //config.Formatters.Remove(config.Formatters.XmlFormatter);


            /*
             * AreaRegistration.RegisterAllAreas();
             * GlobalConfiguration.Configure(WebApiConfig.Register);
             * FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
             * RouteConfig.RegisterRoutes(RouteTable.Routes);
             * BundleConfig.RegisterBundles(BundleTable.Bundles);
             * */
        }
        public void AddDefinitionIfFound_AddsDefinitionWithVerSupportIfFileFound()
        {
            // Arrange
            var map = new ScriptResourceMapping();
            var sd  = new ScriptResourceDefinition
            {
                Path         = "~/Scripts/",
                DebugPath    = "~/Scripts/",
                CdnPath      = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-{0}.min.js",
                CdnDebugPath = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-{0}.js",
                CdnSupportsSecureConnection = true
            };
            var vpp  = Substitute.For <VirtualPathProvider>();
            var vd   = Substitute.For <VirtualDirectory>("~/Scripts/");
            var file = Substitute.For <VirtualFile>("jquery-1.6.2.js");

            file.Name.Returns("jquery-1.6.2.js");
            vd.Files.Returns(new List <VirtualFile> {
                file
            });
            vpp.GetDirectory("~/Scripts/").Returns(vd);
            ScriptResourceMappingExtensions.VirtualPathProvider = vpp;

            // Act
            map.AddDefinitionIfFound("jquery", typeof(Page).Assembly, sd,
                                     @"^jquery-" + ScriptResourceMappingExtensions.VerRegexPattern + @"(?:\.min){0,1}\.js$");

            // Assert
            Assert.IsNotNull(map.GetDefinition("jquery", typeof(Page).Assembly));
        }
Example #4
0
        protected void Application_Start(object sender, EventArgs e)
        {
            ScriptResourceDefinition jqueryDef = new ScriptResourceDefinition();

            jqueryDef.Path = "https://code.jquery.com/jquery-3.4.1.min.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", jqueryDef);
        }
        protected void Application_Start(object sender, EventArgs e)
        {
            ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();

            myScriptResDef.Path = "~/Scripts/jquery-2.0.3.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);
        }
        public void AddDefinitionIfFound_AddsDefinitionWithNoVerSupportIfFileFound()
        {
            // Arrange
            var map = new ScriptResourceMapping();
            var sd  = new ScriptResourceDefinition
            {
                Path = "~/Scripts/"
            };
            var vpp  = Substitute.For <VirtualPathProvider>();
            var vd   = Substitute.For <VirtualDirectory>("~/Scripts/");
            var file = Substitute.For <VirtualFile>("foo.js");

            file.Name.Returns("foo.js");
            vd.Files.Returns(new List <VirtualFile> {
                file
            });
            vpp.GetDirectory("~/Scripts/").Returns(vd);
            ScriptResourceMappingExtensions.VirtualPathProvider = vpp;

            // Act
            map.AddDefinitionIfFound("foo", typeof(Page).Assembly, sd, @"^foo.js$");

            // Assert
            Assert.IsNotNull(map.GetDefinition("foo", typeof(Page).Assembly));
        }
Example #7
0
        protected void Application_Start(object sender, EventArgs e)
        {
            ScriptResourceDefinition scriptResDef = new ScriptResourceDefinition();

            scriptResDef.Path = "~/Scripts/jquery-3.5.0.min.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", scriptResDef);
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Usuarios usuario = new Usuarios();
            ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();

            myScriptResDef.Path         = "~/Scripts/jquery-1.4.2.min.js";
            myScriptResDef.DebugPath    = "~/Scripts/jquery-1.4.2.js";
            myScriptResDef.CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js";
            myScriptResDef.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);

            MsjLabel.Text = "";
            if (!IsPostBack)
            {
                Session["Modificando"] = false;
                int IdUsuario = 0;
                IdUsuario = Util.ObtenerEntero(Request.QueryString["IdUsuario"]);

                if (IdUsuario != 0)
                {
                    ClearButton.Visible = true;
                    SaveButton.Visible  = true;
                    IdTextBox.Visible   = true;
                    IdTextBox.Text      = IdUsuario.ToString();
                }
                if (usuario.Buscar())
                {
                    llenacampo(usuario);
                }
            }
        }
Example #9
0
        protected void Application_Start(object sender, EventArgs e)
        {
            ScriptResourceDefinition myDef = new ScriptResourceDefinition();

            myDef.Path = "~/scripts/jquery-3.1.0.min.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myDef);
            Application["prev_id"] = 1;
        }
Example #10
0
 protected void Application_Start(object sender, EventArgs e)
 {
     var jQuery = new ScriptResourceDefinition
     {
         Path         = "~/Scripts/jquery-2.1.4.min.js",
         DebugPath    = "jquery-2.1.4.js",
         CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-2.1.4.min.js",
         CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-2.1.4.js"
     };
 }
Example #11
0
        public static void SCritpValidacion()
        {
            ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();

            myScriptResDef.Path         = "~/Scripts/jquery-1.4.2.min.js";
            myScriptResDef.DebugPath    = "~/Scripts/jquery-1.4.2.js";
            myScriptResDef.CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js";
            myScriptResDef.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);
        }
Example #12
0
    /// <summary>
    /// Initializes jQuery for the Required Field Validation.
    /// Source: https://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.scriptresourcemapping%28v=vs.110%29.aspx
    /// </summary>
    private void InitJquery()
    {
        ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();

        myScriptResDef.Path         = "~/Scripts/jquery-1.4.2.min.js";
        myScriptResDef.DebugPath    = "~/Scripts/jquery-1.4.2.js";
        myScriptResDef.CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js";
        myScriptResDef.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js";
        ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);
    }
Example #13
0
        protected void Application_Start(object sender, EventArgs e)
        {
            ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();

            myScriptResDef.Path         = "~/thirdparties/twitterbootstrap/js/jquery-3.3.1.min.js";
            myScriptResDef.DebugPath    = "~/thirdparties/twitterbootstrap/js/jquery-3.3.1.min.js";
            myScriptResDef.CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js";
            myScriptResDef.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);
        }
Example #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();

            myScriptResDef.Path         = "~/Scripts/jquery-1.4.2.min.js";
            myScriptResDef.DebugPath    = "~/Scripts/jquery-1.4.2.js";
            myScriptResDef.CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js";
            myScriptResDef.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);
        }
Example #15
0
        protected void Application_Start(object sender, EventArgs e)
        {
            ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();

            myScriptResDef.Path         = "~/JS/jquery-1.8.1.js";
            myScriptResDef.DebugPath    = "~/JS/jquery-1.8.1.js";
            myScriptResDef.CdnPath      = "http://code.jquery.com/jquery-1.8.1.js";
            myScriptResDef.CdnDebugPath = "http://code.jquery.com/jquery-1.8.1.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);
        }
Example #16
0
        protected void Application_Start(object sender, EventArgs e)
        {
            var jQuery = new ScriptResourceDefinition {
                Path         = "~/Scripts/jquery-2.1.0.min.js",
                DebugPath    = "~/Scripts/jquery-2.1.0.js",
                CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-2.1.0.min.js",
                CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-2.1.0.js"
            };

            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", jQuery);
        }
Example #17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptResourceDefinition jQuery = new ScriptResourceDefinition();

            jQuery.Path         = "~/Scripts/jquery-1.8.0.min.js";
            jQuery.DebugPath    = "~/Scripts/jquery-1.8.0.js";
            jQuery.CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.8.0.min.js";
            jQuery.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.8.0.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", jQuery);
            ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.WebForms;
        }
Example #18
0
        protected void Application_Start(object sender, EventArgs e)
        {
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            var jQuery = new ScriptResourceDefinition
            {
                Path         = "~/Scripts/jquery-2.1.4.min.js",
                DebugPath    = "~/Scripts/jquery-2.1.4.js",
                CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-2.1.4.min.js",
                CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-2.1.4.js"
            };
        }
        protected void Application_Start(object sender, EventArgs e)
        {
            var jQuery = new ScriptResourceDefinition {
                Path      = "~/Scripts/jquery-2.0.3.min.js",
                DebugPath = "~/Scripts/jquery-2.0.3.js"
            };

            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", jQuery);

            //BundleConfig.RegisterBundles(BundleTable.Bundles);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
        protected void Application_Start(object sender, EventArgs e)
        {
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();

            myScriptResDef.Path         = "~/Scripts/jquery-2.1.0.min.js";
            myScriptResDef.DebugPath    = "~/Scripts/jquery-2.1.0.js";
            myScriptResDef.CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-2.1.0.min.js";
            myScriptResDef.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-2.1.0.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            FechaTextBox1.Text = string.Format("{0:G}", DateTime.Now);


            ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();

            myScriptResDef.Path         = "~/Scripts/jquery-1.4.2.min.js";
            myScriptResDef.DebugPath    = "~/Scripts/jquery-1.4.2.js";
            myScriptResDef.CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js";
            myScriptResDef.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);
        }
Example #22
0
        protected void Application_Start(object sender, EventArgs e)
        {
            var jQuery = new ScriptResourceDefinition
            {
                Path         = "~/scripts/jquery-2.1.0.min.js",
                DebugPath    = "~/scripts/jquery-2.1.0.js",
                CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-2.1.0.min.js",
                CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-2.1.0.js",
            };

            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", jQuery);

            RouteConfig.RegisterRoutes(RouteTable.Routes); //RouteTable innehåller alla Routes... vi skickar alltså in den som en parameter som alla routes läggs in i.
        }
Example #23
0
        void Application_Start(object sender, EventArgs e)
        {
            // Codice eseguito all'avvio dell'applicazione
            RegisterRoutes(RouteTable.Routes);

            ScriptResourceDefinition jQuery = new ScriptResourceDefinition();

            jQuery.Path = "/js/jquery-1.8.1.min.js";

            //jQuery.DebugPath = "/js/jquery-1.8.1.min.js";

            jQuery.CdnPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.8.1.min.js";

            //jQuery.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.8.1.js";

            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", jQuery);
        }
Example #24
0
        protected void Application_Start(object sender, EventArgs e)
        {
            //validering
            var jQuery = new ScriptResourceDefinition
            {
                Path         = "~/Scripts/jquery-2.0.3.min.js",
                DebugPath    = "~/Scripts/jquery-2.0.3.js",
                CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-2.0.3.min.js",
                CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-2.0.3.js"
            };

            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", jQuery);

            //URL:er
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
Example #25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();

            myScriptResDef.Path         = "~/Scripts/jquery-1.4.2.min.js";
            myScriptResDef.DebugPath    = "~/Scripts/jquery-1.4.2.js";
            myScriptResDef.CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js";
            myScriptResDef.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);

            if (!IsPostBack)
            {
                dt.Columns.AddRange(new DataColumn[3] {
                    new DataColumn("Descripcion"), new DataColumn("Meta"), new DataColumn("Logrado")
                });
                ViewState["PresupuestoDetalle"] = dt;
            }
        }
Example #26
0
        protected void Application_Start(object sender, EventArgs e)
        {
            var jqueryDef = new ScriptResourceDefinition()
            {
                Path         = "~/Scripts/jquery-2.0.1.min.js",
                DebugPath    = "~/Scripts/jquery-2.0.1.js",
                CdnPath      = "http://code.jquery.com/jquery-2.0.1.min.js",
                CdnDebugPath = "http://code.jquery.com/jquery-2.0.1.js"
            };

            var jqueryUiDef = new ScriptResourceDefinition()
            {
                Path         = "~/Scripts/jquery-ui-1.10.2.min.js",
                DebugPath    = "~/Scripts/jquery-ui-1.10.2.js",
                CdnPath      = "http://code.jquery.com/jquery-ui-1.10.3.min.js",
                CdnDebugPath = "http://code.jquery.com/jquery-ui-1.10.3.js"
            };

            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, jqueryDef);
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, jqueryUiDef);
        }
Example #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptResourceDefinition jQuery = new ScriptResourceDefinition();

            jQuery.Path         = "~/Scripts/jquery-1.12.4.min.js";
            jQuery.DebugPath    = "~/Scripts/jquery-1.12.4.js";
            jQuery.CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.12.4.min.js";
            jQuery.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.12.4.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", jQuery);

            ValidationSettings.UnobtrusiveValidationMode = UnobtrusiveValidationMode.WebForms;


            bool autenticato = (System.Web.HttpContext.Current.User != null) &&
                               System.Web.HttpContext.Current.User.Identity.IsAuthenticated;

            if (autenticato)
            {
                Response.Redirect(Login1.DestinationPageUrl);
            }
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        #region jQuery
        ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();
        myScriptResDef.Path         = "~/Scripts/jquery-1.10.2.min.js";
        myScriptResDef.DebugPath    = "~/Scripts/jquery-1.10.2.js";
        myScriptResDef.CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.10.2.min.js";
        myScriptResDef.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.10.2.js";
        ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);
        #endregion jQuery

        #region Logged User
        User user = Session["User"] as User;
        if (user == null)
        {
            PanelUser.Visible = false;
            string name = Path.GetFileName(Request.PhysicalPath).ToLower();
            if (name != "login.aspx" && name != "register.aspx")
            {
                Response.Redirect("login.aspx");
            }
        }
        else
        {
            PanelUser.Visible  = true;
            LabelUsername.Text = user.Name;
            GravatarUser.Email = user.Email;
            LabelCoins.Text    = user.Coins.ToString();
        }
        #endregion Logged User

        string culture = Session["Culture"] as string;

        if (culture != null)
        {
            Page.Culture   = culture;
            Page.UICulture = culture;
        }
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.FechaTextBox.Text = string.Format("{0:G}", DateTime.Now);
            ScriptResourceDefinition myScriptResDef = new ScriptResourceDefinition();

            myScriptResDef.Path         = "~/Scripts/jquery-1.4.2.min.js";
            myScriptResDef.DebugPath    = "~/Scripts/jquery-1.4.2.js";
            myScriptResDef.CdnPath      = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js";
            myScriptResDef.CdnDebugPath = "http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.js";
            ScriptManager.ScriptResourceMapping.AddDefinition("jquery", null, myScriptResDef);

            if (!IsPostBack)
            {
                dt.Columns.AddRange(new DataColumn[] { new DataColumn("Id Producto"), new DataColumn("Descripcion"), new DataColumn("Precio"), new DataColumn("Cantidad") });
                ViewState["Detalle"] = dt;

                producto        = new Productos();
                listaRelaciones = new List <FacturasProductos>();
                factura         = new Facturas();
            }
            FechaTextBox.Enabled = false;
            ComboCliente();
        }
        public override IEnumerable <ScriptDefinition> GetScripts()
        {
            var instance = Configuration.WebSection.Instance;
            var scripts  = instance?.Scripts;

            if (scripts != null)
            {
                foreach (Configuration.Script script in scripts)
                {
                    var resource = new ScriptResourceDefinition()
                    {
                        Path         = script.Path,
                        DebugPath    = script.DebugPath,
                        CdnPath      = script.CdnPath,
                        CdnDebugPath = script.CdnDebugPath,
                        CdnSupportsSecureConnection = true
                    };
                    yield return(new Web.ScriptDefinition()
                    {
                        Name = script.Name, Definition = resource
                    });
                }
            }
        }