tagged [asp.net-mvc-4]

ASP.NET WebAPI + Soap

ASP.NET WebAPI + Soap Does WebAPI support SOAP? I'm trying to write a SOAP Server in MVC4 and whilst I can do it in WCF it seems that WebAPI is replacing this but I see no ways to utilize SOAP in this...

3 Jul at 19:11

Set Label for checkbox in razor

Set Label for checkbox in razor How does one set the label of a checkbox? I looked at some sites and they are using lambda expressions, but I can't understand them. I am new to asp.net MVC.

13 May at 11:28

Change OWIN Identity password with out old password by code?

Change OWIN Identity password with out old password by code? I have a web application in MVC5 with OWIN Identity and i want to know if there is a posibility to change from code a user password with ou...

RabbitMQ undefined: There is no template at js/tmpl/login.ejs

RabbitMQ undefined: There is no template at js/tmpl/login.ejs All of a sudden when I try to access RabbitMQ it only displays this on screen: > undefined: There is no template at js/tmpl/login.ejs Any ...

How to put conditional Required Attribute into class property to work with WEB API?

How to put conditional Required Attribute into class property to work with WEB API? I just want to put which is work with I am using Model State validation via ()

drawing charts into ASP.NET MVC 4 (Razor,C#) web sites

drawing charts into ASP.NET MVC 4 (Razor,C#) web sites Is it possible to draw charts (curves, histogram, circle) using C# via ASP.NET MVC 4 (Razor). I'm trying to make some graphics from data extracte...

DataAnnotation to compare two properties

DataAnnotation to compare two properties Is there any way of using data annotations to compare two form field (eg. to confirm an email address) are the same, before allowing the form to be posted? eg....

{version} wildcard in MVC4 Bundle

{version} wildcard in MVC4 Bundle In MVC 4 we have bundles. While defining the bundles we can use wildcards like * for all files in a folder. In the example below what does `-{version}` mean?

Return HTML from ASP.NET Web API

Return HTML from ASP.NET Web API How to return HTML from ASP.NET MVC Web API controller? I tried the code below but got compile error since Response.Write is not defined:

How would you detect the current browser in an Api Controller?

How would you detect the current browser in an Api Controller? I'm trying to detect the current web browser within one of my Api Controllers in my program using MVC4. Everywhere I look people say to u...

25 Jun at 19:45

Iterate through dynamic form object

Iterate through dynamic form object Using mvc i get values like this to avoid class declarations and router changes. I like to iterate through all values and check them for null or empty.

Html.BeginForm with html attributes asp.net mvc4

Html.BeginForm with html attributes asp.net mvc4 I have Edit Action with `Html.BeginForm`. How can I add HTML attributes? I know only one way: but if I use this method I cannot pass current ID Is it p...

28 Jan at 21:32

OWIN Startup Class Missing

OWIN Startup Class Missing I'm getting this error as my project is not able to find the reference for `OWIN` startup class. I've even installed all the OWIN reference packages through Nuget still gett...

can't access the added service reference

can't access the added service reference I've added a service reference to my mvc4 web project and left it with the default namespace "ServiceReference1", but when I wanna use that namespace, visual s...

MVC model boolean display yes or no

MVC model boolean display yes or no i have a boolean field in my model in mvc 4 entity framework 4.5 i want to display the field in my view i use this call but i got true or false, ### i want to get y...

How to secure Elmah with ServiceStack

How to secure Elmah with ServiceStack Since Elmah relies on ASP.NET security the following web.config section does not work with ServiceStack authorizations: ```

27 Jan at 11:44

MVC4 Razor difference in @model and @inherit in view header?

MVC4 Razor difference in @model and @inherit in view header? To make a view strongly typed we can use `@model` and `@inherit`. Can you please tell me what the difference is between both of them? Edit:...

ASP.NET MVC4 Redirect to login page

ASP.NET MVC4 Redirect to login page I'm creating a web application using ASP.NET MVC 4 and C#. I want all users to be logged in before using application. I'm using ASP.NET Membership with a custom dat...

26 Jul at 15:18

Is it possible to embed Youtube/Vimeo videos in Markdown using a C# Markdown library

Is it possible to embed Youtube/Vimeo videos in Markdown using a C# Markdown library I'm writing a web app in .NET MVC4 and would like to use Markdown. I understand there are a few open source C# Mark...

25 Apr at 08:34

ReadOnly Attribute in MVC 4

ReadOnly Attribute in MVC 4 While the toot-tip says, ![enter image description here](https://i.stack.imgur.com/u9fq5.jpg) I tried using it but could not make it to work. I am not sure how it works and...

How do I set a cookie on HttpClient's HttpRequestMessage

How do I set a cookie on HttpClient's HttpRequestMessage I am trying to use the web api's `HttpClient` to do a post to an endpoint that requires login in the form of an HTTP cookie that identifies an ...

11 Sep at 16:38

Is it possible to use async/await in MVC 4 AuthorizeAttribute?

Is it possible to use async/await in MVC 4 AuthorizeAttribute? The only override I see exposed on MVC's `AuthorizeAttribute` is `public override void OnAuthorization( AuthorizationContext filterContex...

How to show alert message in mvc 4 controller?

How to show alert message in mvc 4 controller? I tried show a alert box in mvc controller by if-else condition.But alert box does not display.Where is my mistake ? Controller ``` public ActionResult I...

5 Jul at 07:49

ServiceStack WSDL does not include all types

ServiceStack WSDL does not include all types I created a web service within my MVC application. All contracts are using the same namespace. `AssemblyInfo.cs` also maps the `ContractNameSpace` with `Cl...

11 Nov at 21:52

How to get ParameterInfo Value?

How to get ParameterInfo Value? I am using the below code to get Calling Method name and its parameter inside a method. ``` var stackTrace = new StackTrace(); var methodName = stackTrace.GetFrame(1).G...

27 Feb at 10:26