asp.net-mvc

Query Membership using Linq

Hi, I am not a experienced programmer, I need to query the Membership User Collection provided in asp.net mvc. I want the members be able to add other members as friends, I have created a added friend table. Id, MemberId, Friend_MemberId, DateAdded I want to display a list of Members which are not added to this list (like filter alre...

Innerjoin in Linq-to-sql for this in asp.net mvc?

I use asp.net mvc... How to write an inner join in linq-to-sql for this sql query select M.Mat_id,M.Mat_Name,T.Name as Measurement,M.Mat_Type as Description from Material as M inner join MeasurementTypes as T on M.MeasurementTypeId = T.Id where M.Is_Deleted=0 And my repository class has this, public class ConstructionReposit...

Which View Engine are you using with ASP.NET MVC?, and Why?

Hi, I'm thinking of experimenting with alternative View Engines for ASP.NET MVC, and would like to know what other people are using. Please let me know 1) Which View Engine you use, and 2) Why. The standard 'web-forms' view engine is of course a valid answer, but please say so only if you have decided to use it for a reason, not just ...

What setup in .Net would most resemble Django

At work we are inte process of starting development on a new web-based product. Before doing so we need to establish what technology stack we are going to use. For this application my preference would have been to use Django but since the development- and management-team is soo heavily rooted with Microsoft the new product will have to b...

Is it possible to have catchall followed by other parameters in a ASP.NET MVC Route?

I would like to create a route that looks something like this: routes.Add(new Route("{*url}/{action}.do/{id}", new MvcRouteHandler()) Is this possible? It seems like the catchall has to be last? ...

What tools you use to design web application in Asp.net or Asp.net mvc ?

I have recently started working on web applications and i'm doing it using ASP.Net MVC. I have been checking out some open source applications. Some of the views that i checked had alot of markup code, so i was wondering are there any other tools used to visualize and develop views, in a more visual way.. Thanks. ...

Can I Inherit a view of Asp.net mvc2 from normal asp.net master page

Can I Inherit a view in asp.net mvc2 from normal asp.net master page ...

How to get rid of this error in asp.net-mvc?

I am using Linq-to-sql as an ORM. I wrote this innerjoin public IQueryable<Material> FindAllMaterials() { var materials=from m in db.Materials join Mt in db.MeasurementTypes on m.MeasurementTypeId equals Mt.Id select new { m.Mat_id, m.Mat_Name, Mt.Name, ...

Model Binding using ASP.NET MVC, getting datainput to the controller.

Pretty Basic one here guys. I have a View which holds 2 textfields for input and a submit button <%using (Html.BeginForm("DateRetrival", "Home", FormMethod.Post)){ %> <%=Html.TextBox("sday")%> <%=Html.TextBox("eday")%> <input type="submit" value="ok" id="run"/> <% }%> the following controller action which I want to bind the dat...

Asp.Net MVC EditorTemplate Model is lost after Post

I have a controller with two simple Methods: UserController Methods: [AcceptVerbs(HttpVerbs.Get)] public ActionResult Details(string id) { User user = UserRepo.UserByID(id); return View(user); } [AcceptVerbs(HttpVerbs.Post)] public ActionResult Details(User user) { return View(user); } Then there is one simple view for displayin...

ASP.Net MVC 2: How to keep values in the model between posts

I have an edit view that is displaying some model properties as plain text and other model properties as input fields. My problem is that the model properties displayed as plain text are null when the model is returned to the view after a validation error. How do I retain the model values when I don't have input fields for all propertie...

The name 'AppHelper' does not exist in the current context

When its giving an error saying AppHelper does not exist, am I missing any reference? <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage<DocumentsController.ViewDetails>" %> <%@ Import Namespace="DocuvaultMVC.Controllers" %> <asp:Content ID="Content1" Con...

Why does my submit button fail to trigger Javascript MVC?

I have a simple code from a book and the code should display data from my controller in the "results" span. What am I missing? Controller... public string GetQuote(string symbol) { if (symbol.Trim() != "") return "99"; else return "Sorry"; } ASPX... <%@ Page Title="" Language="C#"...

Does ASP.NET Tracing work in MVC2 Views?

I have a VS 2010 MVC2 .NET 4.0 web application. ASP.NET tracing is enabled both in the Page directive (Trace="true) and in the Web.config: <trace enabled="true" requestLimit="10" pageOutput="true" traceMode="SortByTime" localOnly="true" writeToDiagnosticsTrace="true" /> A standard trace lis...

Is there something like the PHP function nl2br() for ASP.NET MVC?

Is there stock standard function that does newline to <br /> encoding in ASP.Net MVC? ...

Spitting out a Index view using parameters

Hello guys. I'm using ASP.MVC and trying to learn... I have the following controller // get all authors public ActionResult Index() { var autores = autorRepository.FindAllAutores(); return View("Index", autores); } // get authors by type public ActionResult Index(int id) { var autor...

ASP.Net MVC elegant UI and ModelBinder authorization

We know that authorization's stuff is a cross cutting concern, and we do anything we could to avoid merge business logic in our views. But I still not find an elegant way to filter UI components (e.g. widgets, form elements, tables, etc) using the current user roles without contaminate the view with business logic. same applies for mode...

ASP.NET Line Breaks in Title Element

I'm trying to optimize SEO readability on our websites and one issue I've come across is ASP.NET butchering the title element of my MasterPage. Entered as such in my MasterPage (manually reformatted to remove line breaks caused by the <% %> tags): <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /> - <%=WebsiteSettings.We...

ASP.NET MVC Data access from action attributes

Hello, I was wondering if it's a good/bad practice to access database from ASP.NET MVC action attributes? Thank You ...

Show different sub-sets of a view model's properties in an edit view

In the context of C# 4, ASP.NET MVC 2, and NHibernate; I've got the following scenario: Let's assume an entity Product that have an association to ProductType. In a product edit view; how do I implement that only a sub-set of the product's properties are shown based on the ProductType association in an elegant and DRY way? I.e., differ...