asp.net-mvc

How do I access a Post method without a submit button

I am working on a MVC project that works fine when the submit button is clicked to access the Post method. I have a side menu that I would like to access the Post method and save the necessary changes before redirecting. How do I do that? <fieldset> <% Html.RenderPartial("SideMenu", Model); %> </fieldset> <fieldset> //data wit...

Using WCF DataContract in MVC SessionState using AppFabric cache

Hi, I have a Data Access Layer, a Service Layer, and a Presentation Layer. The Presentation Layer is ASP.NET MVC2 RTM (web), and the Service Layer is WCF (services). It's all .NET 3.5 SP1. The problem is that in the services, the objects being returned are marked with the [DataContract] attribute. The web is using the AppFabric Cache (...

HTMLHelper RadioButton

Hello I'm new in .net Family and i've been looking asp.net webpage and following the MVC tutorials the problem is I'm using LinQ to Sql (2005) model and C# and i need to put a radioButton to know if a date must be initialized or not how do i do this using html helpers ?? ...

ASP.NET MVC HTML helper methods for new HTML5 input types

HTML5 appears to support a new range of input fields for things such as: Numbers Email addresses Colors URLs Numeric range (via a slider) Dates Search boxes Has anyone implemented HtmlHelper extension methods for ASP.NET MVC that generates these yet? It's possible to do this using an overload that accepts htmlAttributes, such as: H...

How can .NET MVC render forms based on external XML?

A non-developer wants the ability to modify scripts that users read on several screens. For example, the first script may read, "Thanks for calling, how may I help you?" and contain some input elements. After clicking a "Next" button on this screen, they are presented with another form with another script with more input elements. Ho...

MVC Partial Login Control Return View

Hi, This is a follow on from: http://stackoverflow.com/questions/3605689/mvc-partial-login-control I got the AccountController Logon Post event firing from my child control. The problem I have now is that when a user enters an incorrect password the AccountController Logon post tries to return to the Logon.aspx page not my Logon partial...

MVC + jQuery: how to create an input text through Html.TextBox() and specifying a "class" attribute

I'm trying to create an input text through the following code so it can hold a date that user can choose in a date-picker jQuery control: <%: Html.TextBox("date", null, new {class = "date-pick"}) %> <input name="date" id="date" class="date-pick" /> Problem is, I need to specify the "class" attribute for the input text, but...

.NET MVC Custom Date Validator

I'll be tackling writing a custom date validation class tomorrow for a meeting app i'm working on at work that will validate if a given start or end date is A) less than the current date, or B) the start date is greater than the end date of the meeting (or vice versa). I think this is probably a fairly common requirement. Can anyone poi...

Working with links asp.net mvc2

How do I make a static link in a view? (using ASP.NET MVC2) I am working on the site navigation, and have basically 4 main areas. These are split into sub areas, and one controller looks after the entire "main area". So basically after clicking on a main area, i'd like to display a list of links to the different sub areas. I created th...

Routes in Global.asax doesn't register

Hei guys i have this JQuery Ajax call from my view and it looks like this: $("select#Colors").change(function() { var color = $("#Colors > option:selected").attr("value"); $.ajax({ type: "GET", contentType: "application/json; charset=utf-8", url: "FindProducts/" + color, d...

hide url in asp.net MVC

actually i just want to show main address of my site like "http://localhost/website/" and want to keep this address for my all of views(security Purpose so that after login no one can navigate through address bar not also for those pages for which person is authenticated person should only supposed to navigate from menus) which i wi...

ASP.NET MVC: The model item passed into the dictionary is of type 'ClassA', but this dictionary requires a model item of type 'ClassA'.

I'm getting a peculiar exception using the Html.RenderPartial method. ASP.NET MVC seems to be unable to an object of type ClassA to an object of type ClassA. I was wondering if anyone knows what's going on. Here's a little more background info. I'm having the following hierarchy in place: public interface IInterface { string Name {...

Access Facebook UserId in Facebook Canvas before OAuth Authentification

In my facebook canvas applikation, i store the access token in session. (I use ASP.NET MVC) But i want to store the access token in a database along with the facebook user id that i can save different access tokens for different facebook users accessing my application. So when i query the facebook user id and if it doen't return any ac...

ASP.NET Development Server is not updating changes to markup/code

I've been working on the ASP.NET Development Server recently (on an MVC project and I'm finding that it is inconsistent in how it serves the changes I make to my code. For example, I make a change to the C#/HTML/CSS/JS in the dev environment and run the page, and the change appears on the screen. But if I edit the HTML again and run the ...

How to log webservice requests from ASP.Net-MVC application to external webservice?

Hello everybody, I have a webapplication which uses an external webservice to send files and messages. The IIS runs on a Windows2003 Server. I now need to log somehow the requests which are send by the ASP.NET-MVC application to the external service. In Fiddler2 I just can see the incoming answers from the webservice, but I cannot see ...

implement autocomplete in asp.net mvc

how to implement autocomplete tetbox in asp.net mvc. ...

How can I test if the current request is an ajax request in a Controller?

In some cases I'm sending jQuery.get() requests to an Action Method, and in other cases it's a browser request. Is there any way for me to differentiate between them so I can return different action results accordingly? ...

how to get view data value

I have <%var test = ViewData["test"];%> <ul class= "list" id = "<%test;%>"> but having error message: Only assignment, call, increment, decrement, and new object expressions can be used as a statement What is wrong? ...

Can anyone provide a straight forward example to extend the Html.TextBoxFor helper

I'm hoping that someone can provide a simple, straight forward example of extending the Html.TextBoxFor helper. I would like to include a boolean ReadOnly parameter which will (surprise, surprise, surprise) render the control read only if true. I've seen a few examples which didn't quite do the trick and I've tried the following however,...

Custom Helper using the model

Hi, I'm pretty new to MVC and just read an article about helpers. Now I have this code on the View: <div class="display-label">Ingredients: <% foreach (var e in Model.Products_Ingredients) {%> <%: e.Ingredient.Name%><br /> <%: e.Percentage%> <%if (e.Percentage != null) ...