asp.net-mvc-5

Hangfire implemetation

最后都变了- 提交于 2019-12-13 02:07:29
问题 i am new to hangfire and looking for the solution which can solve the below case take the data from the DB and convert this to CSV file. this should happen when ever the user insert the new record,hangfire should fire end of the day if there is new record inserted. Can we deploy hangfire on the local machine and do the testing 回答1: take the data from the DB and convert this to CSV file You can use hangfire to run any public method on any class in your application. So if you write a method

ASP.NET 5 Azure template deployment failed creating SQL Server

故事扮演 提交于 2019-12-13 02:07:00
问题 I have added a new default ASP.NET 5 web app, and chosen to deploy to AZURE. This works fine, but if I retry and add a azure sql db, then I get the error below as it tries to create the new resource group. Microsoft Visual Studio Template deployment failed. Deployment operation statuses: Failed: /subscriptions/81368473107b/resourceGroups/DJWTestDb/providers/Microsoft.Sql/servers/djwtestdbdbserver () error (InvalidApiVersionParameter): The api-version '2.0' is invalid. The api version must be

Aspnet5 default web application project won't run

試著忘記壹切 提交于 2019-12-13 01:27:19
问题 Why won't the "out of the box" aspnet5 web application project run with the frameworks section set to the TFM "net46" or "net451". I can only get it to run set to "dnx451 or dnx46". If I run it under any of the "netxx" monikers I get a connection refused in the browser instead of the aspnet splash page. UPDATE 1 I get the following when I switch the TFM to "net46" in the project.json file so why is it still targeting the dnx 4.5.1 runtime? Current dnvm shows as above and on another note you

MVC 5 button click event that updates a label on the same form

坚强是说给别人听的谎言 提交于 2019-12-13 01:23:59
问题 Using MVC 5, is it possible to have a button click event that updates a label on the same page? For example, if I have a structure @using (Html.BeginForm()) { <fieldset> <legend>Form</legend> <p> @Html.TextBox("textbox1") </p> <p> @Html.Label("label1") </p> <p> <input type="submit" value="Submit" /> </p> </fieldset> } Clicking the Submit button grabs the textbox1 's value, modifies it according to the function that gets called when the submit button is clicked and then update the value of the

why custom type variable is not saving value MVC

不羁岁月 提交于 2019-12-13 01:03:32
问题 I am trying to build a website using MVC 5. I have a controller class with 3 variables. public class WorkerController : Controller { public ViewModel viewModel = new ViewModel(); private WorkerDB Wdb = new WorkerDB(); private ProjectDB Pdb = new ProjectDB(); First method that gets called is public ActionResult Index(User user) { viewModel.User = user; viewModel.ProjectsList = Pdb.DbSet.ToList(); viewModel.WorkerList = Wdb.DbSet.ToList(); return View(viewModel); } Here, the values of viewModel

Embedding a Silverlight App into a MVC

情到浓时终转凉″ 提交于 2019-12-13 00:55:46
问题 I decided to convert the WPFs into a Silverlight applications. My only problem is trying to get it to display the silverlight application in my MVC web browser. I added all of my silverlight projects into my MVC project. I am just not getting it to show my silverlight application. Can someone tell me what I am doing wrong in my asp part in my CSHTML <h2>System</h2> <asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"> <div id="silverlightControlHost"> <object data=

MVC Attribute Routes & Route Inheritance

和自甴很熟 提交于 2019-12-13 00:49:39
问题 I am trying to get attribute routing in MVC5 to let me inherit the routes from a base controller. Example: public abstract class BaseController: Controller { [Route("")] public virtual ActionResult Index() [Route("edit/{id}")] public virtual ActionResult Edit(TKey id) //etc } [RoutePrefix("people")] public class PersonController : BaseController { //etc } Then obviously I should have /people for the Index page, /people/edit/1 for the Edit page etc. However, it seems like this is not supported

MVC model binding to edit a list not working

不羁的心 提交于 2019-12-13 00:45:27
问题 I can't figure out why this won't work. Everything I've read (both here and across the web) says this is how to bind to a list for editing but I'm not having any success. I have two problems: The HTML form elements emitted by the view are not being indexed (each one is named "Qty" and "BoxID" instead of "[0].Qty" and "[0].BoxID"). Everything I've read on this subjuct says the HTML.EditorFor and HiddenFor helpers should pick this up automatically. Even when I manually change the view to spit

Add-Migration not working with MySQL

梦想与她 提交于 2019-12-13 00:27:23
问题 I have downloaded Asp.Net MVC 5.x Single page web application from https://aspnetboilerplate.com/Templates. I'm using MySQL and followed the steps mentioned in link https://aspnetboilerplate.com/Pages/Documents/EF-MySql-Integration. But when I run the Add-Migration command it gives the error. MyCompany.MyProject.Web\Web.Config: <add name="Default" connectionString="Server=127.0.0.1;port=3306;Database=SparTestDb;uid=root;password=root" providerName="MySql.Data.MySqlClient"/> MyCompany

Make EditorFor render decimal value as type=“text” not type=“number”

大兔子大兔子 提交于 2019-12-13 00:25:21
问题 I have two properties in a model class: public int? IntTest { get; set; } public decimal? DecimalTest { get; set; } Which I then render with: @Html.EditorFor(model => model.IntTest, new { htmlAttributes = new { @class = "form-control"} }) @Html.EditorFor(model => model.DecimalTest, new { htmlAttributes = new { @class = "form-control"} }) I'd expected both of them to render as html inputs of type number, but the decimal one doesn't, I get: <input class="form-control text-box single-line" data