asp.net-mvc-4

Kendo mvc grid InLine Edit Mode DateTimePicker Template gives Error

折月煮酒 提交于 2021-02-08 20:33:16
问题 I am using Kendo UI mvc grid for Data listing. I am making InLine Editing in this Grid.I am using EditorTemplate for DateTime field, so that it will give datetimepicker for DateTime field in InLine Edit Mode.When i am going to Click on Update button, it will give me Validation message like this : 'The must be a date' columns.Bound(k => k.SevenDaysFrom).Format("{0:dd.MM.yyyy}").EditorTemplateName("DateTime").Width(30); columns.Bound(k => k.SevenDaysTo).Format("{0:dd.MM.yyyy}")

Multiple types were found that match the controller named 'Account'. MVC 4 & using RouteConfig.CS

假如想象 提交于 2021-02-08 15:21:42
问题 I currently have 2 projects in same folder. Main Project1 Project2 Problem: Multiple types were found that match the controller named Account . This can happen if the route that services this request ('{controller}/{action}/{id}') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the MapRoute method that takes a namespaces parameter. The request for Account has found the following matching

Multiple types were found that match the controller named 'Account'. MVC 4 & using RouteConfig.CS

夙愿已清 提交于 2021-02-08 15:21:17
问题 I currently have 2 projects in same folder. Main Project1 Project2 Problem: Multiple types were found that match the controller named Account . This can happen if the route that services this request ('{controller}/{action}/{id}') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the MapRoute method that takes a namespaces parameter. The request for Account has found the following matching

How to insert values into an existing PDF on the fly?

*爱你&永不变心* 提交于 2021-02-08 11:42:32
问题 There is a PDF with some fields to accept values from the user(for example: a "bio data" form). My question is that how can I insert the user inputs to the Correct fields of the existing PDF and to generate the filled PDF? if i using iTextSharp, then how can i choose the co ordinates to print values? Is there any design tools to design rectangle fields to accept values? because my PDF template have lots of fields to get values from user side. tnx in adv. 回答1: There are two possibilities: Your

passing file to controller without using form,

丶灬走出姿态 提交于 2021-02-08 10:35:16
问题 guys i am trying to load file from view to controller with out using form , while browsing a file the file should be loaded to controller using Ajax ,is it possible? <td>Import Excell file:</td> <td><input type="file" id="fileUpload" name="fileUpload" /></td> $('#fileUpload').die().live("change", function (e) { e.preventDefault(); var file_name = $("#fileUpload").val(); var fileName = $("#fileUpload").val(); var fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1); var file_data

After upgrade to asp.net 5.2.3, CORS isn't working for “*” origins

徘徊边缘 提交于 2021-02-08 08:43:18
问题 I have a project using web api and one using asp.net mvc. They are configured using CORS module. The project using Web Api is configured to allow any origin because it's deployed on Azure and it's an OData endpoint, so we don't know who is going to consume it. OData endpoint configuration // inside configuration config.EnableCors(); // controllers [EnableCors(origins: "*", headers: "*", methods: "*")] [Authorize] [HttpPost] public void ... From my MVC client, using Angular $http we issue an

Getting Html.AntiForgeryToken throws error “Server cannot modify cookies after HTTP headers have been sent”

非 Y 不嫁゛ 提交于 2021-02-08 07:34:22
问题 When I attempt to run the following code: <form id="__SendAjaxAntiForgery" action="#" method="post"><%= Html.AntiForgeryToken()%></form> I get the following error "Server cannot modify cookies after HTTP headers have been sent." The stack trace reads at System.Web.HttpResponse.BeforeCookieCollectionChange() at System.Web.HttpCookieCollection.Set(HttpCookie cookie) at System.Web.Helpers.AntiXsrf.AntiForgeryWorker.GetFormInputElement(HttpContextBase httpContext) at System.Web.Helpers

Getting Html.AntiForgeryToken throws error “Server cannot modify cookies after HTTP headers have been sent”

霸气de小男生 提交于 2021-02-08 07:34:19
问题 When I attempt to run the following code: <form id="__SendAjaxAntiForgery" action="#" method="post"><%= Html.AntiForgeryToken()%></form> I get the following error "Server cannot modify cookies after HTTP headers have been sent." The stack trace reads at System.Web.HttpResponse.BeforeCookieCollectionChange() at System.Web.HttpCookieCollection.Set(HttpCookie cookie) at System.Web.Helpers.AntiXsrf.AntiForgeryWorker.GetFormInputElement(HttpContextBase httpContext) at System.Web.Helpers

Jquery to Check ModelState is Valid or not

橙三吉。 提交于 2021-02-08 07:29:33
问题 I want to check whether the ModelState is Valid or not through jquery. In My scenario if he click on submit button, and the fields fulfilled the requirement of Required Attributes, i want to open model popover, otherwise we want to show the errors, can any one tell me how to check ModelState is valid or not? 回答1: For this I think you have two ways of working around. First you can simply make a ajax post to your controller (say: public JsonResult IsModelStateValid(YourModel model) { return

Hosting provider blocks webservice response - (1and1 hosting)

▼魔方 西西 提交于 2021-02-08 06:19:14
问题 I have an application written in ASP.NET MVC 4. I got access to remote web service. I added it to my solution as WebReference. When i call it's methods on my localhost all works great, the problem is on deployed version. Server provider run it as "Medium Trust". When i call WebService methods from hosted application i got an error: I think the problem is in firewall rules on hosting server, my binding type for the service is "basicHttpBinding" with defaults settings. In this case my listening