mvc

What is the best way to create printable letters from an MVC application?

What's the best way to create printable letters from an MVC application? I'm looking for sort of a mail merge thing from my app that prints a form letter with various values filled in. In ASP.NET, I previously did this by creating an HTML document and displaying it as application/msword, but I did that with code-behind, which isn't an (...

ASP.NET mvc on mono 2.2

Hi, I am having a trouble. I am trying to run asp.net mvc 1.0 on mono 2.2.I have copied the system.web.mvc.dll to bin directory. I have done HttpContext.Current.RewritePath("/Home/Index");. Still I am having te error: Server Error in '/' Application The incoming request does not match any route Description: HTTP 500. Error processing r...

How Does a Login system generally work with OOP?

Sorry if this is a badly formed question, but I'm trying to make my web applications (using PHP) more OO. *EDIT* I'm developing the Framework myself */EDIT* Everything is great so far, I've made a Front Controller system that taps into a MVC system. The FC figures out what page you want, loads the specific page Controller (*EDIT* which e...

How to persist a data set between MVC calls

The following setup kind of works, but it's not the proper use of TempData, and it falls down after the first use. I suspect I'm supposed to be using ViewData, but I'm looking for some guidance to do it correctly. In my Home controller, I have an Index action that shows which members need to have letters created: Function Index() As Ac...

Binding an NSPopupButton to an NSDictionaryController

I'm trying out some MacOS programming and having some trouble understanding how bindings work with an NSPopupButton. I'm interested in binding to an NSDictionaryController (I don't think I need an intermediate NSArrayController but if that is the best way, I'm open to it). I've created a controller object that has a property 'db' which...

Why is ASP.NET MVC limited to ASP?

Duplicate MVC .NET For the Desktop? I've developed some ASP.NET MVC apps, and loving the framework. However, one thing I don't quite understand is why it's limited to web UIs. It seems like one of the reasons for a separation of the view and controller is to allow for multiple views to reuse the same controller logic. For example...

In ASP.NET MVC, how do you retrieve the filename of the script being run?

I need to get the name of the script being executed on the master page to update the Last Write time. I'm using this: System.IO.File.GetLastWriteTime(Server.MapPath(Request.FilePath)) which works for the default.aspx, but if its within a View I am unable to workout what the physical path to the file is to get the LastWriteTime. Is t...

For ASP.NET MVC Rescues View, how do we add ViewData fields?

Hi, I have several Rescues defined for possible faults, however I am unable to access the ViewData to populate it with things we need the masterpage requires to render. Is this hidden away in a controller we can utilise? Thanks, ...

What's the best way to respond to checkbox clicks on an MVC list view?

I've got a list view in my MVC app that shows a check box next to each entry: <% For Each item In Model%> <%=Html.CheckBox("Selected", item.select_flag, New With {.onclick = "this.form.submit();"})%> <%=Html.Hidden("ID", item.id)%> <%=item.name%> <br/> <% Next%> As you can tell from the onclick, I'm submitting the form...

ASP.NET MVC: Use existing Account or create new User controller?

I'm creating a new ASP.NET MVC application. So far I've used the Account controller for actions related to a user's account -- Login/Logout, Activation (like Register, but I use Register for other actions in the site so I've renamed it), Add/Update Contact information. Up to now, though, I've been concentrating on the administrative use...

How do you choose between an asp.net webform and mvc application?

This is a difficult question to ask because it's so wide ranging. Does anybody know of a scoring system of questions that would aid in choosing between a WebForms and MVC application at the start of a project? e.g. Is TDD an important part of this project? (If yes score 1 for MVC and 0 for WebForms) ...

asp.net MVC Ajax Request Not Firing Correctly

I cannot figure out why this Ajax request is not firing correctly. For simplicity's sake I've been trying to implement Ajax request using this tutorial. However I cannot get my controller to recognize the request as being so. I've tried placing the Ajax.ActionLink within the div to be updated (outside of it here). Using the Response...

ASP.NET MVC jQueryUI datepicker not working when using AJAX.BeginForm

I have an ASP.NET MVC Partial View that contains a Html.TextBox that is configured to use the datepicker from JQueryUI. This is done by ensuring the style is set to .datepicker. This all worked fine. However I have changed my forms to Ajax.BeginForm and included a Ajax.ActionLink that displays it after clicking on the link. Since addi...

ASP.NET MVC Ajax.ActionLink

Hi, When i click on a Ajax.ActionLink, which displays a partial view, why does none of the javascritp associated with the partial view fire? This previously all worked before when I used Html.ActionLink. I have a series of scripts referenced in master page, which include $document.Ready functions. I have also tried added the script i...

ASP.NET MVC 1.0 + Mono 2.4

Trying to get MVC running on Mono 2.4 (which is possible, according to some threads here) without much luck. I can't get past this: Compilation Error Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error. Compiler Error Message: : ** (/usr/local/lib/mono/2.0/g...

Open window on click in textbox using jQuery

Hello, I want to create a functionality similar to what www.redfin.com has on their search page. A search form is opened as a user clicks in the text box. I am using MVC and jQuery but am not sure how to go about it. I tried using the Dialog plugin but for some reason the dialog only opens once. <input id="txtSearch" type="text" /> <d...

How do you activate the MVC templates in VS2008 from a WebForms App

I'm in the process of adding ASP.NET MVC to a WebForms app. One of the neat features of an ASP.NET MVC solution that you create from scratch is that a right click on the solution explorer and Add > New Item... will give a list of templates which include the MVC templates. However, in a WebForms app these templates don't appear. I though...

How do I save an entity for the first time that requires another pre-existing entity to be attached to it

I need to save a Company entity to the database as a new entity. In order to do this I need to associate a CompanyType entity to the Company entity. I can't save the Company without do this. Do I attach the newly created company to the context and then attach the company type entity to the company and then save my results? This code ...

What's your 'no framework' PHP framework?

Even with a ton of PHP frameworks out there to choose from, I know many people prefer a minimal, personal set of libraries. What is your method when it comes to 'rolling your own' framework for PHP applications, and how does it vary depending on the type/scope of a project? What does your script look like for a typical page? What is yo...

REST Url Structure - Can ID of Resource go before controller?

The standard template for ASP.NET MVC (and MVC in general) seems to be {controller}/{action}/{id}, however, on a project i'm currently working on i'm not sure if that is an appropriate structure. If for example I had an application that controlled a car, to me it would make more sense to me to have the structure below: {car-rego}/{con...