I'm sure this has been asked already, but I can't find the answer.
I have a Project model, which has a belongs_to relationship with my Client model. A client has a name, but a project doesn't necessarily have a client.
In my view, I've got code like this:
<%=h project.client && project.client.name %>
because if the project doesn't h...
I use the jQuery Tools Overlay plugin and I have this code here
<script type="text/javascript">
var overlayElem;
$(document).ready(function () {
$("a[rel]").live('click', function (e) {
e.preventDefault();
overlayElem = $(this);
$(this).overlay({
...
Here is the scenario
In MVC, it is easy to return a Javascript to be executed on the client
public ActionResult DoSomething()
{
return JavaScript("alert('Hello world!');");
}
On the client, I have a Javascript that takes a JSon object as parameter
Something similar to this :
function open(options) {...}
I ...
I have a sample I'm building, that's using the Northwind database.
I have a view in which I show all the products for a specifc category and use a ul to generate items with an image and the products name and price.
I have used the code here, http://blogs.msdn.com/b/miah/archive/2008/11/13/extending-mvc-returning-an-image-from-a-controll...
Hi all,
I'm developing a unicode web application (in hebrew).
and my route looks like:
"SomeUnicodeHebrewWord/{CategoryId}/{CategoryName}/{Page}
When i use the actionlink the SomeUnicodeHebrewWord and CategoryName (also in hebrew) are getting html encoded. how can i avoid that?
can't i have the links created with th hebrew characters? ...
I'm using the Telerik controls form MVC and they work great in my work/home dev environments, and in the work prod environment, but when I tried to deploy to my home prod environment (IIS7) I get a problem.
I've added the axd mime type, but wan't sure what else to do.
I read a post suggesting adding a handler, but wasn't sure if I'm se...
Lets say we have a class with a property called PetsName. If it is left blank on the screen I want to update the value provider so if the user doesn't enter a pet name, we force 'unnamed'. This isn't the actual scenario.. this is of course a sample, so answers like 'just set default values on a webpage, etc' won't fit this scenario : )
...
i am uploading an image ,when uploading image of a very large size the application crashes . i am checking the image size as well . but uploading image of a very large size bypass everything and crashes the application. What do u people suggest? what is the best practise?
...
I currently have this in my ApplicationController
def account_path
eval "#{current_user.type.downcase}_account_path"
end
I use it for redirects, etc. But I also want to use it in the view (for link_to's etc). Is this is a legit case to share code between the controller and view to keep it DRY even though it breaks MVC?
...
On A c# mvc website, I created a controller with the name NotFound, and then created a default route to an index action on the controller. When I debugged the program it went to the correct controller action but did not display anything in the view. Does any one know why?
...
ASP.Net Html.TextBoxFor (and the other XxxxxFor editor helper methods) default to rendering a field prefix. How do I disable field prefixes so it simply renders the property name as the Name/ID?
Here's an example:
<%= Html.EditorFor(m => chart.Title) %>
is rendered as:
<input id="Chart_Title" name="Chart.Title" type="text" value="">...
I've been learning about the Model-View-Controller paradigm ("MVC"), but I'm quite confused since some tutorials contradict other tutorials.
My current understanding of the process looks something like this:
Router / Dispatcher / Front Controller:
Though not specifically referenced in the "MVC" name, the Router is still a very import...
Hi,
I am trying to merge my vb.net Web application project with my c# mvc project not ideal at all but the project is too big to do it any other way.
any ideas would be much appreciated!
Thanks
Ash :D
...
(I am using ASP.Net MVC, but this seems like a more generic MVC question)
Say you have a domain model representing a person, and you have a view for editing a person. Included in the Person domain object is a State of Residence property, and in the view you want a dropdown that lists states.
Is there any reason not to create a view ...
Hi All, I would like to download ASP.NET MVC web site template. Please guide me where can i find and how i can use. I'm new to this pattern. Thanks in advance.
...
i want to implement the "in" in sql in linq to sql .how can i do that ?
...
Hi,
I am getting an error saying:
The model item passed into the dictionary is of type 'System.Data.Linq.DataQuery`1[WebUI.Models.MailListViewModel]', but this dictionary requires a model item of type 'WebUI.Models.MailListViewModel'.
This is in my controller:
public ViewResult List()
{ var mailToShow = from m in mailReposito...
I have read most of the literature Google and SO provides on this (correct me if I've missed something).
What I am trying to do is to localize an MVC site using resources, I want the compiletime safety of strongly typed resource files (ResX) but the flexibility of the ASP.NET 2.0 Resource-Provider Model, or something similar to that. I ...
When we load a view, we can pass some dynamic data to it.
What I would like to achieve is when the view receives no data, it uses some default data that is loaded from a model (database).
The problem is I don't really want to put these statements (that loads the default data) in the view.
What is the simplest solution available, witho...
The company for which I work for has built a large ASP.NET MVC application last year and it wasn't prepared to support Localization to begin with as the main goal of this application was to serve portuguese clients. But as the application took greater proportions, the demands were that it should support other languages, like english for ...