asp.net-mvc

MVC crazy property lose its value. Does Html.HiddenFor bug?

给你一囗甜甜゛ 提交于 2021-02-08 14:13:12
问题 There something really weird happening in my MVC application that drives me crazy. On my MVC Page, after a user got selected, it's Login should be "rendered" twice on the HTML. Once in the form of FrmNextStep('<Login>', ... (where Model.SelectedUser.Login is used) and once in the form of <input id="SelectedLogin" name="SelectedLogin" value="<Login>" type="hidden"> (where "Model".SelectedLogin is used) but the second one always stay blank. It's really weird because, despite the two call not

A storage mechanism has already been configured for this application

匆匆过客 提交于 2021-02-08 13:27:04
问题 I am getting this error whenever my S#arp Architecture attempts to start and this is an problem with SQL Server (for example: SQL Server is not runing), after I start SQL Server and hit refresh, I get this error: A storage mechanism has already been configured for this application 回答1: Try to add this line before calling NHibernateSession.Init() to clear any previous initiation. try{ NHibernateSession.Reset(); } catch { } 回答2: NHibernateSession.Init() or InitStorage() is being called more

Search date from the detail asp.Net mvc 5

大兔子大兔子 提交于 2021-02-08 12:13:06
问题 on clicking search,nothing happenI am trying to filter the detail with date property in asp.net mvc 5 code first. but it's not working. i have only create a model class from which code first generate a controller and view for it. now i want to filter the detail on the index page with respect to date. here is the code i am using. Model Class:- public class Meeting { public int MeetingID { get; set; } public String Name { get; set; } public String designation { get; set; } [Display(Name = "9:00

Search date from the detail asp.Net mvc 5

拜拜、爱过 提交于 2021-02-08 12:07:07
问题 on clicking search,nothing happenI am trying to filter the detail with date property in asp.net mvc 5 code first. but it's not working. i have only create a model class from which code first generate a controller and view for it. now i want to filter the detail on the index page with respect to date. here is the code i am using. Model Class:- public class Meeting { public int MeetingID { get; set; } public String Name { get; set; } public String designation { get; set; } [Display(Name = "9:00

FileHelpers.Dynamic.ClassBuilder.CreateRecordClass Error

寵の児 提交于 2021-02-08 12:01:21
问题 I'm trying to reading a file with layout created at runtime. But when running FixedLengthClassBuilder.CreateRecordClass (), an exception occurs: Error Compiling Expression: Line 31: The type or namespace name 'SGCompras' could not be found (are you missing a using directive or an assembly reference?). My code: public void ReadFile(string filePath){ ... var itemsLayout = Context.FixedLayouts.Where(p => p.LayoutName == "Margem").ToList(); var builder = GetFixedClass(itemsLayout, "Margem"); var

View - dynamic model

时光怂恿深爱的人放手 提交于 2021-02-08 11:47:18
问题 I am attempting to create a dynamic table in my view that will be dynamically generated depending on the type of model I send to the view. So, I basically have two actions: public IActionResult People() { List<Person> lst = new List<Person>(); // Add data... return View("Table", lst); } public IActionResult Teams() { List<Team> lst = new List<Team>(); // Add data... return View("Table", lst); } Now I would like to have the same view that will show a list of people / teams, so that I don't

How to use RenderAction with custom Routing?

百般思念 提交于 2021-02-08 11:16:25
问题 we are starting to use routes for our MVC project, so we basicly replace ActionLink() with RouteLink() - now we want to replace RenderAction() to add route information we need (mainly the routename)... Here is one of our mappings: // Route für Tools route = routes.MapRoute( name: "Tool", url: "tool/{controller}/{action}", defaults: new { controller = "Home", action = "Index" }, namespaces: new[] { "Web.Controllers.Tool" }); route.DataTokens["UseNamespaceFallback"] = false; So with

How to use RenderAction with custom Routing?

不问归期 提交于 2021-02-08 11:14:13
问题 we are starting to use routes for our MVC project, so we basicly replace ActionLink() with RouteLink() - now we want to replace RenderAction() to add route information we need (mainly the routename)... Here is one of our mappings: // Route für Tools route = routes.MapRoute( name: "Tool", url: "tool/{controller}/{action}", defaults: new { controller = "Home", action = "Index" }, namespaces: new[] { "Web.Controllers.Tool" }); route.DataTokens["UseNamespaceFallback"] = false; So with

.NET Core DinkToPDF not showing bootstrap columns properly

杀马特。学长 韩版系。学妹 提交于 2021-02-08 10:45:14
问题 These are my settings for DinkToPDF: var document = new HtmlToPdfDocument() { GlobalSettings = { PaperSize = PaperKind.A4, Orientation = Orientation.Portrait, Out = @Path.Combine(path, QuoteId + ".pdf") }, Objects = { new ObjectSettings() { HtmlContent = result } } }; converter.Convert(document); When I load the view via navigation in my web app, it shows the page rendered nicely. However, when I generate the pdf, the bootstrap columns aren't used at all. Instead, the right column is pushed

.NET Core DinkToPDF not showing bootstrap columns properly

我是研究僧i 提交于 2021-02-08 10:44:30
问题 These are my settings for DinkToPDF: var document = new HtmlToPdfDocument() { GlobalSettings = { PaperSize = PaperKind.A4, Orientation = Orientation.Portrait, Out = @Path.Combine(path, QuoteId + ".pdf") }, Objects = { new ObjectSettings() { HtmlContent = result } } }; converter.Convert(document); When I load the view via navigation in my web app, it shows the page rendered nicely. However, when I generate the pdf, the bootstrap columns aren't used at all. Instead, the right column is pushed