I am creating a simple web site to get more familiar with MVC 2.0. I've been doing web forms since 1.0 and getting ready to start a major overhaul of a web forms site to MVC. So want to build a smaller app to work out the learning curve.
So I'm going to build a time tracking application. I'm using ASP.NET MVC 2.0 and LINQ to SQL. I pl...
I need to add class attribute to the body tag from a view file (.aspx), but the tag is in the master file. How can I access the body tag from a view?
...
I'm developing an ASP.NET MVC multi site application (can host multiple sites from the same application instance / multi-tenant application).
I've previously done this in a web forms application and loaded up the appropriate site configuration data (by inspecting the url) on the page_load event of a custom base page.
With ASP.NET MVC w...
The Background:
We are supplied with html files - 'wrappers' - from our client, into which we need to inject the content that we produce. They have different wrappers for different pages and we have to inject the corresponding content into a special tag that they supply in the wrapper.
The wrapper file name corresponds to the name of t...
The question as to how to display an image, stored as an image in the database and as a byte array in code, has been answered several times (e.g., http://stackoverflow.com/questions/880515/display-image-from-database-in-asp-mvc), but what if you want to display the image in the context of a form. That is, I have an object that has sever...
I'm currently in the middle of a reasonably large question / answer based application (kind of like stackoverflow / answerbag.com)
We're using SQL (Azure) and nHibernate for data access and MVC for the UI app.
So far, the schema is roughly along the lines of the stackoverflow db in the sense that we have a single Post table (contains bo...
When I get the data using the URL in browser, I'm able to see the related data, for example:
http://localhost/services.svc/Dinners(1)/RSVPs
That lists 5 RSVPs for DinnerId = 1 in my case, but when I'm consuming the OData from a different project, I can only retrieve Dinners, debugging the app shows that RSVPs = 0, while it should be 5....
The name is pretty confusing probably. I have a requirement where a URL must be name friendly to represent dates (schedule/today, schedule/tomorrow etc). I don't want to clutter my route mappings with DateTime.Now, DateTime.Now.AddDays(1) etc for different parameters so I decided to create routes that map to an action of the same name:
...
If I don't know what htmlhelper I want to use during design time.., Then is it appropiate to try to new up an htmlhelper from within the controller once I understand which model I will be using? So can I make from a controller an htmlhelper and add it to a view later that was not marked up to use the model? Like a data driven applicat...
I know that if I have a form with multiple elements with the same name I can use this to bind to an array, but is there any way to pass an array from a javascript function to an ASP.NET MVC controller action without using a form?
...
Actually i am using server side validation and saw article that only adding link to java script file and using <%Html.ClientValidationEnabled = true%> will automatically enable client side validation but first of all i am using Visual Web Developer 2010 Express 4.0.30319
and here it show error that <%Html.ClientValidationEnabled = true...
How do you calculate a relative path in ASP.NET MVC?
...
hello all,
I'm almost embarrassed to ask this question, but here goes. Yesterday I was testing an application that's due to go into production in a few weeks time when an unusual error was triggered by one of my collegues. Basically, she pulled the database connection whilst the view was iterating round an IQueryable collection (inside ...
Hey, I'm a first time write long time reader of this site.
I'm building an .NET MVC site, using ProfilBase to store a custom user object.
The profile base is stored on an database on an other server than the webserver.
I have an helper class, UserInfoHelper that contains static method to retrive username, email, telephone etc.
Right n...
In brief, I'm looking for a way move complex object graphs between browser code (jQuery) and server code (ASP.NET MVC). JSON does not support object references, so standard serialization of a circular referencing object is not possible out-of-the-box.
A proposed standard for JSON object references is floating about, which is currently ...
I looking for some information on how to build an ASP.NET MVC application using nHibernate and n-tier layers.
Can I have example please.
...
Iv created an editor template for the boolean type. And it works fine in all modern browsers expect IE8 where any value changes seem to be lost when they are posted to the server.
I have read there are 'issues' with MVC checkboxs retaining their values, and as a result the Html.CheckBox helper includes a hidden field on the page to sto...
Are there any jquery extensions available for asp.net mvc? I'm looking for adapters which can be used instead of having to write all javascripts manually. for instance: just include jqgrid script in the master page, call CreateGrid extension metod to define the grid and return a JqGridActionResult from an action to populate it.
I found ...
Does anybody know of a good algorithm to mutually exclusively check two properties using a ModelValidator?
Something like:
[EitherPropertyRequired("BuildingNumber","BuildingName"]
public class Address{
public int BuildingNumber { get; set; }
public string BuildingName { get; set; }
}
...
Hi Guys,
I'm designing a new web application. Some quick points on it:
ASP.NET MVC Web Application
SQL Server 2008
Entity Framework ORM
3 User Roles: Anonymous, Registered, Administrators.
Anonymous users can view stuff, Registered Users can post stuff, Admins can do anything
Heavy social integration with Facebook, Twitter and the lik...