asp.net-mvc

Using LINQ-To-Entities to Generate Information

I am working on a website where a user can add tags to their posted books, much like is currently done for questions on Stack Overflow. Classes: Books { bookId, Title } Tags { Id Tag } BooksTags { Id BookId TagId } Here are few sample records. Books BookId Title 113421 A 113422 B Tags Id Tag 1 ASP 2 C# 3 CSS 4 VB 5 V...

MvcContrib Grid and Display/Edit Templates

Has anyone come across a good solution for using ./Views/Shared/DisplayTemplates and ./Views/Shared/EditTemplates with the MvcContrib.UI Grid? I guess I could wireup a CustomItemRenderer, but I would much rather be able to do something like: <% Html.Grid<Person>(Model.People) .Sort(new GridSortOptions {Column = Model.Column, D...

Creating a generic NotFound View in ASP.MVC

Hello guys, I'm having a problem to create a generic View to represent NotFound pages. The view is created and it's fine. I need to know how i can direct the user to the NotFound view in my Controllers and how to render a specific "Return to Index" in each controller. Here is some code: public class NotFoundModel { private string...

Dynamically inserted input elements not showing up in ActionResult's FormCollection parameter

I am adding input elements in a view, dynamically, using JavaScript. But I am unable to find those inputs in my ActionResult's FormCollection parameter...: public ActionResult SomeAction(FormCollection fc) I am able to find static input elements in the View. And using FireBug, I can see that the inputs are inside of the form element, ...

Using FluentValidation with Castle Windsor and Entity Framework 4.0 (POCO) in MVC2

This isn't a very simple question, but hopefully someone has run across it. I am trying to get the following things working together: MVC2 FluentValidation Entity Framework 4.0 (POCO) Castle Windsor I've pretty much gotten everything working. I have Castle Windsor implemented and working with the Controllers being served up by the ...

How to do some performance testing in asp.net mvc?

I am using asp.net mvc 2.0 and I want to test how long it takes to execute some of my code. In one scenario I do this load xml file up. validate xml file and deserailze. validate all rows in the xml file with more advanced validation that cannot be done in the schema validation. then I do a bulk insert. I want to measure how long st...

server caching problem on ASP.NET MVC page

Hi I have server caching error on ASP.NET MVC Pages. The scenario is like this. I have two applications (1).External Website and (2).Internal Adminsite, both pointing to the same Database. There is one page called EditProfile Page on the External Website that registered customer can update his profile information like Firstname, Lastn...

Python Django vs ASP.NET MVC

Hey guys ! i'm fairly new at web development scene and i was wondering if you guys can help me break up the pros and cons of using python django vs asp.net mvc besides the maturity level of its framework. I have intermediate experience with JAVA. As of right now, i'm leaning towards python but i just wanted to make sure i am making the r...

RenderPartial a view from another controller (and in another folder)

Hey MVC experts. I two database entities that i need to represent and i need to output them in a single page. I have something like this Views Def ViewA ViewB Test ViewC I want to ViewC to display ViewA, which displays ViewB. Right now i'm using something like this: // View C <!-- bla --> <% Html.RenderPartial(Url.C...

Can we Made an anchor tag autoclick in the success function of Ajax Script?

Can we Made an anchor tag autoclick in the success function of Ajax Script? Does it Possible we Click an anchor tag through Ajax Script? if Yes then how?I am using Ajax in asp.net MVC? This is the Viewsource of Partial View <script language="javascript" type="text/javascript"> $(document).ready(function(){ alert("Button clic...

click event launched only once problem

I have a form in which I have many checkboxes. I need to post the data to the controller upon any checkbox checked or unchecked, i.e a click on a checbox must post to the controller, and there is no submit button. What will be the bet method in this case? I have though of Ajax.BeginForm and have the codes below. The problem im having...

How do I create a strongly typed BeginForm?

I've seen a few examples of people using this syntax for HTML.BeginForm: (Html.BeginForm<Type>(action => action.ActionName(id))) But when I try this syntax all I get is a: The non-generic method System.Web.Mvc.Html.FormExtensions.BeginForm(System.Web.Mvc.HtmlHelper)' cannot be used with type arguments What am I missing? Visual Stud...

paging helper asp.net mvc

Hi, I have implemented a paging html helper (adapted from steven sanderson's book). This is the current code: public static string PageLinks(this HtmlHelper html, int currentPage, int totalPages, Func pageUrl) { StringBuilder result = new StringBuilder(); for (int i = 1; i <= totalPages; i++) { ...

joining stored proc result with a query linq to entities

Hi Experts, I am working with linq to entities where I have a stored proc which returns an enetity based on some parameters. I can get this result in program. Now I want to join this resultset with similar entity on a common field. my entity Books { BookId, Title } Stored Proc GetFilterBooks(someparam) ( Select * from books wher...

Accessing current IPrinciple in a Master View in Asp.Net MVC

I currently have a abstract controller class that I all my controllers inherit from. I want to be able to use the current user (IPrinciple) object in my master page. I read that I could use the contructor of my abstract base controller class, that is I could do something like public BaseController() { ViewData["UserName"] =...

Facebook style hide|Delete

Hi, Can any one suggest any way to do facebook style, news feed hide, delete, without updating the page, or redirect. ...

Asp.Net MVC Handle Drop Down Boxes that are not part of the Model

I have a small form which the user must fill in and consists of the following fields. Name (Text) Value (Text) Group (Group - Is a list of option pulled from a database table) Now the Model for this View looks like so, public string Name { get; set; } public string Value { get; set; } public int GroupID { get; set; } Now the view is...

ASP.NET MVC Custom MetadataProvider

I'm building a custom MetadataProvider and I'd like to access the actuall model value in the CreateMetadata method. public class IcpMetadataProvider : AssociatedMetadataProvider { protected override ModelMetadata CreateMetadata(IEnumerable<Attribute> attributes, Type containerType, Func<object> modelAccessor, Type modelType, strin...

checkbox val not showing false

I have the follwoing code: $("input:checkbox").live('click', function() { alert($(this).val()); }); True is shown if the checkbox is checked. However, if the checkbox is checked and I uncheck it, the value shown is still true. How can I correct that? What is wrong with the code? Thanks ...

How to disable radiobuttons and checkboxes produced by HtmlHelper methods in ASP.NET MVC?

Hello, I have a series of pages (in a wizard type application). After collecting user's inputs here and there, I'd like to display a summary in a single page. I don't want the users to modify information on that page, just to visualize them. Otherwise, he they go back to the prevoius pages to do so. To obtain that, I use Html.Encode(Mo...