mvc

What could cause an error with .Net 4.0 and IIS 6?

I have two websites on IIS 6 that throw server errors when they are set to ASP.NET 2 (via the ASP.NET tab in IIS properties) - one because of a dependancy on a library built in .NET 4, the other because it is an N4/MVC2 application which specifies 4.0 as it's targetFramework in config. When I change the setting in the ASP.NET tab to be ...

MVC - dispose resource in controller

Hi folks, What's the proper way of disposing resources when a method in the controller returns filestream or file or filecontentresult objects ? For ex when doing something like below: using CrystalDecisions.CrystalReports.Engine; public ActionResult Report() { ReportClass rptH = new ReportClass(); rptH.FileName = Server....

asp.net mvc script and style references

I'm trying to include script and style references that will not break on deployment, however I can not even get the references to work locally. I have tried using Url.Content() and MVCContrib's <%=Html.ScriptInclude("")%>. My scripts are in a Scripts folder on the root of the site; my styles are in the usual Content/css/ folder. The s...

Reading DATA from an OBJECT asp.net MVC C#

Hi, I am new to the MVC and I am stuck with a wierd situation. I have to read the Data from the type object and I tried different ways and I couldn't get a solution.Please help. IList<User> u = new UserRepository().Getuser(Name.ToUpper(), UserName.ToUpper(), UserCertNumber.ToUpper(), Date.ToUpper(), UserType.ToUpper(), Company.T...

Where to store a DataSource resource in a Java web app?

This is a rookie question. What's the best place to put @Resource private DataSource ds; in a web application? Do I put it in a servlet, context listener or maybe there's a better place for it? Also, do I create a new Connection object in my doGet()/doPost() or should I do it somewhere else? What's the best practice for stuff like thi...

TFS and code coverage for web application (MVC) assemblies not working

I've got an MVC web application with associated controller tests that run under a TFS build as per normal. I can see the tests running and passing in the build log and they appear in the "Result details for Any CPU/Release" section of the build I also have a number of other assemblies with associated tests that are running in the same ...

UI form component for ASP NET MVC

Hi I'd like to find a component that help me to build input forms in asp MVC. I find that ther are many components (grid, tree, tab...) but not a "Form component". I know that i can use the HTML HELPER (.labelfor(.. .inputTextFor(... ) ..but i don't like to write the html tags around the fields and labels ( ... ) I want that all the form...

asp.net mvc jquery hidden field

the thing is that I have a form with a textbox and a button and a hidden field, now what i want to do is to write something in the textbox ,pass it to the hidden field and then access that thing written in the hidden field in the controller . how can i do that? ...

is it possible to add a string template to views in a .net mvc project?

Hi, I have a newbie question,, how do i add a string template to the views folder in a .net mvc project? I have added a reference to StringTemplate.dll and antlr.runtime.dll? but seems that is not enough. i.e. when i right-click on views and choose Add >> New Item i can't find a file with .st extension in the list that i get... how d...

getting identity of the saved record

Feature feature = new Feature(); feature.vcr_FeaturesName = AddedNode.ToString(); feature.int_ParentId = 0; feature.int_CreatedBy = 1; feature.dtm_CreatedDate = DateTime.Now; FeatureRepository.Ad...

Any samples of MVC2 + Silverlight 4? Visual Studio 2010 does not organize the files correctly.

I create a SL4 Application and then I say I want to create a MVC site in addition. But instead of create a VIEW and putting showing the SL4 object there and creating a empty MVC type Default page... it just creates a SilverlightApplicationTestPage.aspx in the root! Does anyone know any small sample code anywhere that shows how to set up...

Personal Project question MVC.NET

My site is Main Site and the demo portal is Demo Site Idea is for small restaurants can create there own website (subdomain) and they can offer their products online for people to preorder online. I've got to a point were I'm a bit stuck so I'd like to get some feedback from people and I apologise if this is not appropriate. What ar...

SelectedValue on html drop down list in MVC

I am new to MVC, so sorry if I am being a bit thick. I am using VB I am trying to fill an html drop down list using data from a db, but the first item is always selected, no matter what. What am I doing wrong? Here is my code - In the controller: ViewData("MatchTypeList") = New SelectList(_db.GetMatchTypes.ToList(), "MatchTypeID", "...

How do I make a custom ActionLink?

I need to include an image within the <a> tag of an ActionLink. What is the best way to do this? The final rendered link should look like this, <a href="/Home/Test"><img src="test.jpg" />Test</a> ...

MVC-style model binding in WCF?

I want to bind POSTed form values to parameters in my WCF operation in the same way that ASP.Net MVC allows me to do. So, for example if my form has "customer.Name" and "customer.Age" parameters, I want to make a standard HTML POST to a named endpoint/operation that takes a customer parameter and have it instantiated and populated like ...

linq groupby in strongly typed MVC View

How do i get an IGrouping result to map to the view? I have this query: var groupedManuals = manuals.GroupBy(c => c.Series); return View(groupedManuals); What is the proper mapping for the ViewPage declaration? Inherits="System.Web.Mvc.ViewPage<IEnumerable<ProductManual>>" ...

ASP.NET WebForms vs MVC [after VS2010/.NET 4.0 announcement]

Two of the biggest advantages of MVC over webforms were non-existent viewstate and URL routing. VS2010 and .NET 4.0 incorporates built-in URL routing for Webforms as well as better control for viewstate. I advocate use of MVC for extranet sites due to the MVC design pattern and its general lightweight nature but in light of this new an...

Use database field maxlength as html layout input maxlength best practice. asp.net mvc

Hello everybody, There are string length limitations in database structure (email is declared as nvarchar[30] for instance) There are lots of html forms that has input textbox fields that should be limited in length for that reason. What is the best practice to synchronize database fields and html layout input fields length limitations...

Applying mvc to domain-driven design

From a practical point of view, how can you adapt the domain model to the MVC pattern? For example, could I use some wrapper classes? ...

flex sharing data between different components

i have in my flex application various mxml components that all need to show stats based on the same data. how can i go about doing that? do i need some mvc framework like cairngrom or puremvc for that or can i do it without them? any design ideas? ...