My background is .net 2.0 development using web forms. Before I was laid off I was looking into MVC which I enjoy very much. I have a few clients that I am consulting for and I now have to make a decision to either stay the course with ASP.NET MVC or switch to ruby rails or cakephp/codeigniter.
If I choose ASP.NET MVC I would have to up...
Is this possible? Here's what I'm trying:
public ActionResult Index()
{
dynamic p = new { Name = "Test", Phone = "111-2222" };
return View(p);
}
And then my view inherits from System.Web.Mvc.ViewPage<dynamic> and tries to print out Model.Name.
I'm getting an error: '<>f__AnonymousType1.Name' is inaccessib...
Input:
Id, PartId, Name
1, 1, Head
1, 2, body
1, 3, Tail
2, 1, Head
2, 2, Leg
Output Display:
- Head, Body, Tail [Delete(1)]
- Head, Leg [Delete(2)]
My Code:
<ol>
<%
int prev = -1;
foreach (var item in t)
{
if(prev != item.ResponseId){
if (prev != -1)
{%>
<%= Html.Actio...
http://img6.imageshack.us/img6/1331/19748435.png
Looking at that image is the menu bar on my webpage. So far simple but why would firefox show the link in the parentheses while IE doesn't? I disabled all of my addons and it still does it. I looked at the source in firebug and it shows exactly what's in the HTML:
<div id="menu" >
...
Hi,
How can I detect server-side (c#, asp.net mvc) if the loaded page is within a iframe? Thanks
...
I'm creating an ASP.NET MVC solution, and inside I had 2 MVC Website projects.
I'm interested in creating a 3rd project called "Shared", where I can reference the shared views/content between the two sites so I have only one place to edit them.
WebUI.Site1 (ASP.NET MVC Site)
WebUI.Site2 (ASP.NET MVC Site)
WebUI.Shared (Newly created A...
How is it that I can create a method in the controller and just put some arguments and it figures it out after I click on a form submit? Under the hood, how does it find the right method and how does it figure out that I just want those arguments?
...
Hit a roadblock while implementing a sub domain based language switcher (en.domain.com loads English, jp.domain.com loads Japanese).
How do I get a single membership system to work across multiple sub domains (ASP.NET MVC C#)?
Saw something about adding domain="domain.com" to <forms > entry in web.config. Did that, but does that work w...
I'm at a loss... here's my route:
routes.MapRoute("LangOnly", "{language}",
new { controller = "Home", action = "Root", language = "en" },
new { language = @"en|ja" });
it matches www.domain.com/en, but does not match www.domain.com/ja.
huh? I've even gone so far as to comment out any other routes... kind of stuck. ;/
Update...
Can I return a Json result that contains also a rendered view?
I need it to return the new ID of a submitted form along with its HTML and some other properties.
Also that can be helpful when I need to return two (or more) view results from one action inside a Json object.
Thanks!
...
Basically I have a set of checkboxes that are dynamically created from view data like so:
<input type="checkbox" name="Calendars" value="<%= c.ID %>" /><%= c.Name %>
The value being the Calendar Id.
I can get what checkbox has been brought back using the FormsCollection its messy but it works!
(There also seems to be a bug with the...
When I post a 'Model' object (as generated by LinqToSQL) to a controller, I can query 'ModelState.IsValid', and if there are validation attributes on any of the properties and the value doesn't validate, it will be set to 'false'.
However, ModelState.IsValid seems to always return 'true' if I'm posting a custom object of my own class, e...
Hi
I am making a web application in asp.net mvc C# with jquery that will have different pricing plans.
Of course the more you pay the more features you get.
So I was planning to use roles. So if someone buys plan 1 then they get a role of plan 1. Then on the page use an if statement to check if they are in certain roles. If they are a...
I have read several other posts here, so i get the idea on the pro vs. cons, especially having full control over the rendered html code etc. (in MVC).
My question is regarding the UI controls: In MVC, i will have to write all UI controls myself (or the html equivalent). Now is that not going to be very difficult?
The reason why these 3r...
I have noticed that many blogs use URLs that look like this:
http://www.hanselman.com/blog/VirtualCamaraderieAPersistentVideoPortalForTheRemoteWorker.aspx
I assume this is done for search engine optimization.
How is this read from the underlying data model? Do you really search for
VirtualCamaraderieAPersistentVideoPortalForTheRemo...
Hi Experts,
I am working on a MVC project where I have copied a lot of work from NerdDinner project.
In NerdDinner we are returning few views like DinnerNotFound, InvalidOwner if a dinner is not found or if a user is not an owner of the dinner. But In my project want to create an
view (CustomException) and use it for all such reasons. ...
After making any change on controllers I have to rebuild for the changes to be effective. Is there a way to set the application that I don't have to build for code file changes?
...
If I have a simple model like this:
Model:
public class AnimalModel {
public string Species {get;set;}
}
View:
<%= Html.TextBox("Species") %>
ActionMethod (POST):
AnimalModel model = new AnimalModel();
// update model
UpdateModel(model); // updates ViewData.ModeState
// correct spelling
if (model.Speci...
i am extending the default asp.net mvc example.. i am using asp.net membership provider that comes with it . .
the issue is that if i access one of my url's directly without logging on it shows the full page with "Log On" link at the top.
I want it to obvious redirect to the login page, if anyone accesses any of the specific action ur...
I've written a site for my summer internship using ASP.NET MVC. The progress is going well but one thing I have found painful is deployments. Particularly, because we have frequent deployments and I've been doing them by hand.
I'm looking for sort of the "standard" .NET deployment tool that can be utilized with an ASP.NET MVC project ...