asp.net-mvc

Abstract: Should I choose ASP.Net MVC over Web Forms or ..

I've been working with web for over 7 yrs and I've upgraded from html->ASP->ASP.Net and now the new flavors of ASP.Net itself. I was to begin with MVC last year but due to deadline and the complexity involved in MVC I couldn't. Now, once again there's a new upgrade - I've begun with the ASP.Net DD (Dynamic Data) Templates (the latest one...

MVC or Webform , which is the way to go??

Possible Duplicate: Biggest advantage to using ASP.Net MVC vs web forms I'm soon gonna develop a reporting solution. Would be glad if some one let me know , which is the best way to go. Web forms or MVC? ...

Get string property name from expression

I'm trying to write a strongly typed helper which would be something like this: Html.Lookup(x => x.FooId); for now I have this: public static MvcHtmlString Lookup<T,TReturn>(this HtmlHelper<T> html, Func<T, TReturn> expression) { // get string "FooId" here } anybody knows how to get this ? ...

File Upload Limit Issue in asp.net mvc

I have fixed my file upload file size as 50MB using the following code < httpRuntime executionTimeout="60" maxRequestLength="51200"/> in Web.cofig file. When i am uploading more than 25MB file it displays error message as "file or directory not found". How to fix this issue? ...

Why does my button not show up?

Hello, I have a partial view where I render, if the user has choosen an option, a button that permit the user to generate automatically a value for a certain field. Please give a look at this picture to understand what I mean: This is achieved using the following markup on the partial view <%= Html.LabelFor( model => model.IssueCode...

Intermittent Functionality Sending Data from SilverLight to MVC Controller

I have a SilverLight button that gets a comment from a text box to be saved in my database and then closes the window. SilverLight: Task task = new Task(); private void saveChangeBtn_Click(object sender, RoutedEventArgs e) { string commentTxtBxValue = commentTxtBx.Text; task.SaveComment(commentTxtBx.Text); commentTxtBx.Text...

unable to compile Web service project with VS 2008

Hello, I try to compile with VS 2008 old C# Service project based on WSE where DIME attachments are used: The compiler does not find: using Microsoft.Web.Services.Dime I just installed WSE 3.0. Even that does not help to find Microsoft.Web. What is the replacement for DimeAttachment class? thanks Arman EDIT Well the answer w...

Setting Page Title from an HtmlHelper class

I have an HTML Helper that essentially renders static content read from HTML files (inside of a vdir). There are cases when the HTML file has a title element defined and in such cases, the current page should use the given title. The content inside of the body should be rendered where the Helper class is referenced in the View. This is ...

ASP.Net MVC Form action in returned View

Hi there, Will keep this as simple a possible:- I have a have a controller which will return either ViewA or ViewB - e.g. [HttpPost] public ActionResult ViewA(BlahModel model) { if (isTrue) return View(model); else return View("ViewB", model); } ... The problem I have is that ViewB has a form on it. And what hap...

MVC ActionLink add all (optional) paramters from current url

the very famous actionlink: <%: Html.ActionLink("Back to List", "Index")%> Now, this link is in my Details view. The Index view is a search page. The url of that looks like this: http://localhost:50152/2011-2012/Instelling/Details/76?gemeente=Dendermonde&amp;postcode=92**&amp;gebruikerscode=VVKSO114421&amp;dossiernr=114421%20&amp;o...

Returning ad-hoc view models from ASP.NET MVC2 Controllers

Hello - I'm porting an existing system to ASP.NET MVC2. In the current legacy app, the user can select from dozens of available fields to customize CRUD forms for different entities in the domain model, similar to the way ERP systems allow customization of core modules. My question: I'm looking for a good pattern or example for this ki...

ASP.NET MVC 2 Controllers to Model Associations

In my model I have relationships like this: [Person] PersonId (PK) ... [Orders] OrderId (PK) PersonId (FK to Person.PersonId) ... A person can have multiple orders. I generated PersonController with Create/Details/List/Edit views. I want to be able to manipulate Orders also, but within the context of a Person. In other words, I...

Gracefully handling HTML tags on form submission in asp.net MVC 2

Hi I have a MVC site and will have users inputting text to be displayed on a web page. I am trying to come up with a graceful way of handling any HTML that the user try's to input - as you will probably be aware MVC 2 throws an error for any HTML in the text. I use ViewModels and decorate my properties with filters from the DataAnotatio...

DotNetOpenAuth Authentication against Google Apps OpenID using MVC

Hi all, I'm trying to approximate Single Sign on. Currently, the most workable solution involves the user imputing details on my site before being sent off to goggle Apps to authenicate. I'm using dotnetopenauth to send and recieve the requests This means that it takes no account of google apps login cookies should they be present. ...

MVC - Clear default selected value of SelectList

I have a SelectList that gets populated with data from the database. The data comes from a Dictionary<int, string> and populates the SelectList like below. //... Courses = new SelectList(GetCourses(),"Key","Value"); //... On the View, it shows the first record from the database as the default selected value on the dropdown. I'd like...

NHibernate Validator IsNumeric function for ASP.NET MVC 1

I have a custom validator for my class Exceedance. I added the IsNumeric field as follows, [NotEmpty(Message="Field cannot be empty"),IsNumeric(Message="Only numbers allowed")] public virtual int Min { get; set; } [NotEmpty(Message="Field cannot be empty"),IsNumeric(Message = "Only numbers allowed")] public virtual int ...

ASP.NET MVC [HttpPost] action accepts single object, spits back validation errors to ViewPage<CustomViewModel>

I'm experimenting with different combinations of strongly typed view models, full views and partial views, using both RenderPartial() and RenderAction(). The form-post scenario I'm asking about, though, is one that comes from the "main" view--one that isn't a partial. This main view's controller constructs the view model that provides ...

ASP.NET MVC - Insert or Update view with IEnumerable model

I've seen plenty of examples (NerdDinner, Sanderson's Sports Store, etc.) where a view is bound to a collection of objects. The syntax in the view is usually something like this... <%@ Page... Inherits="System.Web.Mvc.ViewPage<IEnumerable<MyViewModel>>" %> ... <% foreach (var myViewModel in Model) { %> I've also seen plenty of exampl...

N Layered MVC Project Question

Hello, I am getting a bit confused about how an N Layered MVC application should look. I am thinking as standard there should be: ASP .NET MVC Project Service Layer Data Access Layer (containing repositories) I am confused as to where the entity framework model should sit (.edmx). Should it be in the Data Access Layer? Should any par...

How to get TinyMVC .NET class Library to work on ASP.NET MVC 2?

Hello SO, I am trying to implement the TinyMCE Spellcheck plugin that uses GoogleSpell. The thing is I am trying to install it in an MVC environment. I started by referencing the .NET class Library DLL (MoxieCode.TinyMCE) in my project. Then, I added this code to my web.config: <system.webServer> <handlers> <add name="TinyM...