After i upgrade my ASP.NET MVC project to Telrik UI version 2024.2.514, many component in my web app in smaller than before upgrade. Some form are broken and unable to use. Do you have any idea causes this issue?
I'm looking forward to your answser. Thanks for your support.
Hello Phạm,
Thank you for posting the files.
Could you also post the Layout file (e.g., _Layout.cshtml), in which the bundles are loaded? In addition to the Layout file content, please open the following file and post its version (it should be listed at the top of the file's content):
bundles.Add(new StyleBundle("~/Content/css").Include(AssembleBundleURL("~/Content/","bootstrap.min.css"),
As for next steps for verifying if some of the style sheets loaded on the page is responsible for the incorrect appearance of the components, I would suggest commenting the following bundles (highlighted in orange):
using System.Configuration;
using System.IO;
using System.Web;
using System.Web.Optimization;
namespace ILS_MVC
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Clear();
bundles.UseCdn = true;
#region CSS
bundles.Add(new StyleBundle("~/Content/css").Include(AssembleBundleURL("~/Content/","bootstrap.min.css"),
AssembleBundleURL("~/Content/","bootstrap-cards.css"),
AssembleBundleURL("~/Content/", "bootstrap-submenu.min.css"),
AssembleBundleURL("~/Content/", "bootstrap-multiselect.css"),
AssembleBundleURL("~/Content/", "bootstrap-theme.min.css"),
AssembleBundleURL("~/Content/", "jquery-ui.min.css"),
AssembleBundleURL("~/Content/", "jquery-ui.structure.min.css"),
AssembleBundleURL("~/Content/", "jquery-ui.theme.min.css")));
bundles.Add(new StyleBundle("~/Content/kendo/css").Include(AssembleBundleURL("~/Content/kendo/2024.2.514/", "bootstrap-main.css"),
AssembleBundleURL("~/Content/", "kendo_2024.2.514_theme_override.css")));
bundles.Add(new StyleBundle("~/Content/cuscss").Include(AssembleBundleURL("~/Content/", "Site.css")));
#endregion
#region JS
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(AssembleBundleURL("~/Scripts/", "jquery-3.7.1.min.js"),
AssembleBundleURL("~/Scripts/", "ils-common.js"),
AssembleBundleURL("~/Scripts/", "ajaxloading.js")));
bundles.Add(new ScriptBundle("~/bundles/codeeffects").Include(AssembleBundleURL("~/Scripts/", "codeeffects.js")));
bundles.Add(new Bundle("~/bundles/kendo").Include(
AssembleBundleURL("~/Scripts/kendo/2024.2.514/", "kendo.all.min.js"),
AssembleBundleURL("~/Scripts/kendo/2024.2.514/", "kendo.aspnetmvc.min.js"),
AssembleBundleURL("~/Scripts/", "jszip.min.js")));//Kendo Export
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(//AssembleBundleURL("~/Scripts/", "jquery.validate-vsdoc.js"),
AssembleBundleURL("~/Scripts/", "jquery.validate.js"),
AssembleBundleURL("~/Scripts/", "jquery.validate.min.js"),
AssembleBundleURL("~/Scripts/", "jquery.validate.unobtrusive.js"),
AssembleBundleURL("~/Scripts/", "jquery.validate.unobtrusive.min.js")));
bundles.Add(new ScriptBundle("~/bundles/jquerynormal").Include(AssembleBundleURL("~/Scripts/", "jquery.unobtrusive-ajax.js"),
AssembleBundleURL("~/Scripts/", "jquery.blockUI.js"),
AssembleBundleURL("~/Scripts/", "bootstrap-submenu.min.js"),
AssembleBundleURL("~/Scripts/", "jquery-ui-1.13.2.min.js")));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(AssembleBundleURL("~/Scripts/", "modernizr-2.8.3.js")));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(AssembleBundleURL("~/Scripts/", "bootstrap.min.js"),
AssembleBundleURL("~/Scripts/", "bootstrap-dialog.js"),
AssembleBundleURL("~/Scripts/", "bootstrap-multiselect.js"),
AssembleBundleURL("~/Scripts/", "respond.min.js"),
AssembleBundleURL("~/Scripts/", "respond.matchmedia.addListener.min.js")));
#endregion
bundles.IgnoreList.Clear();
}
internal static string AssembleBundleURL(string localpath, string filename)
{
string output = string.Empty;
string host = ConfigurationManager.AppSettings["ExternalWebAssetsHost"];
string localFile = HttpContext.Current.Server.MapPath(localpath + filename);
if (File.Exists(localFile))
{
output = localpath + filename;
}
else
{
output = host + filename;
}
return output;
}
}
}
You can then run the application again. If the components appearance is ok, start uncommenting the commented bundles one by one, running the page after each uncommented one, to discover which of the bundles is causing the issue.
Regards,
Ivan Danchev
Progress Telerik
Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
Hi Ivan,
Thanks for the reply, this is my BundleConfig.cs and the Login.cshtml.
using System.Configuration;
using System.IO;
using System.Web;
using System.Web.Optimization;
namespace ILS_MVC
{
public class BundleConfig
{
// For more information on bundling, visit http://go.microsoft.com/fwlink/?LinkId=301862
public static void RegisterBundles(BundleCollection bundles)
{
bundles.Clear();
bundles.UseCdn = true;
#region CSS
bundles.Add(new StyleBundle("~/Content/css").Include(AssembleBundleURL("~/Content/","bootstrap.min.css"),
AssembleBundleURL("~/Content/","bootstrap-cards.css"),
AssembleBundleURL("~/Content/", "bootstrap-submenu.min.css"),
AssembleBundleURL("~/Content/", "bootstrap-multiselect.css"),
AssembleBundleURL("~/Content/", "bootstrap-theme.min.css"),
AssembleBundleURL("~/Content/", "jquery-ui.min.css"),
AssembleBundleURL("~/Content/", "jquery-ui.structure.min.css"),
AssembleBundleURL("~/Content/", "jquery-ui.theme.min.css")));
bundles.Add(new StyleBundle("~/Content/kendo/css").Include(AssembleBundleURL("~/Content/kendo/2024.2.514/", "bootstrap-main.css"),
AssembleBundleURL("~/Content/", "kendo_2024.2.514_theme_override.css")));
bundles.Add(new StyleBundle("~/Content/cuscss").Include(AssembleBundleURL("~/Content/", "Site.css")));
#endregion
#region JS
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(AssembleBundleURL("~/Scripts/", "jquery-3.7.1.min.js"),
AssembleBundleURL("~/Scripts/", "ils-common.js"),
AssembleBundleURL("~/Scripts/", "ajaxloading.js")));
bundles.Add(new ScriptBundle("~/bundles/codeeffects").Include(AssembleBundleURL("~/Scripts/", "codeeffects.js")));
bundles.Add(new Bundle("~/bundles/kendo").Include(
AssembleBundleURL("~/Scripts/kendo/2024.2.514/", "kendo.all.min.js"),
AssembleBundleURL("~/Scripts/kendo/2024.2.514/", "kendo.aspnetmvc.min.js"),
AssembleBundleURL("~/Scripts/", "jszip.min.js")));//Kendo Export
bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include(//AssembleBundleURL("~/Scripts/", "jquery.validate-vsdoc.js"),
AssembleBundleURL("~/Scripts/", "jquery.validate.js"),
AssembleBundleURL("~/Scripts/", "jquery.validate.min.js"),
AssembleBundleURL("~/Scripts/", "jquery.validate.unobtrusive.js"),
AssembleBundleURL("~/Scripts/", "jquery.validate.unobtrusive.min.js")));
bundles.Add(new ScriptBundle("~/bundles/jquerynormal").Include(AssembleBundleURL("~/Scripts/", "jquery.unobtrusive-ajax.js"),
AssembleBundleURL("~/Scripts/", "jquery.blockUI.js"),
AssembleBundleURL("~/Scripts/", "bootstrap-submenu.min.js"),
AssembleBundleURL("~/Scripts/", "jquery-ui-1.13.2.min.js")));
// Use the development version of Modernizr to develop with and learn from. Then, when you're
// ready for production, use the build tool at http://modernizr.com to pick only the tests you need.
bundles.Add(new ScriptBundle("~/bundles/modernizr").Include(AssembleBundleURL("~/Scripts/", "modernizr-2.8.3.js")));
bundles.Add(new ScriptBundle("~/bundles/bootstrap").Include(AssembleBundleURL("~/Scripts/", "bootstrap.min.js"),
AssembleBundleURL("~/Scripts/", "bootstrap-dialog.js"),
AssembleBundleURL("~/Scripts/", "bootstrap-multiselect.js"),
AssembleBundleURL("~/Scripts/", "respond.min.js"),
AssembleBundleURL("~/Scripts/", "respond.matchmedia.addListener.min.js")));
#endregion
bundles.IgnoreList.Clear();
}
internal static string AssembleBundleURL(string localpath, string filename)
{
string output = string.Empty;
string host = ConfigurationManager.AppSettings["ExternalWebAssetsHost"];
string localFile = HttpContext.Current.Server.MapPath(localpath + filename);
if (File.Exists(localFile))
{
output = localpath + filename;
}
else
{
output = host + filename;
}
return output;
}
}
}
Hello Phạm,
Usually such issues are caused by:
Please post:
1. The content of the application's _Layout.cshtml file, so we can check whether the required files are properly loaded. If the js and CSS files are loaded though bundles, post the content of the BundleConfig.cs file as well
2. The content of one of the views shown on the screenshots, on which you see a component that appears smaller than usual
Regards,
Ivan Danchev
Progress Telerik
Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.