If I plan to create a system that is pretty much an MVC .NET site, with the typical separation of components (data, core, ect) but also would like to have a thin Windows client that can access some of those same components remotely, which framework would I want to look at using?
...
I've got an implementation similar to this: http://stackoverflow.com/questions/1710875/better-way-of-doing-strongly-typed-asp-net-mvc-sessions
for quick access to frequently-needed user data... but i have two questions:
1) will there ever be a time when a user is logged in, but the session would be invalid or reset? I always thought th...
I'm using VS2010, ASP.NET MVC 2, and ReSharper 5.0. When I create a new view that's typed off of a model from the same project as my view, ReSharper doesn't see the reference to the model.
This is the definition of my view:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<Web.Domain.UserViewModel>" %>
Domain.UserViewModel ...
Hi
Solution is deployed on server with precomplied option. in local pages are saving but in deployed url error is thrworing.
I am calling controller from web page and controller will call wcf service.
Error details-
System Error. Description: An unhandled exception occurred during the execution of the current web request. Please rev...
Hi,
I want to retain data in the view controls like drop down list, radio button, checkbox, textbox while displaying same view again with validation fail message. Data is in the drop down list bind using the ViewData. Check box data bind using viewdata. User enter values in the textbox and for checkbox control.
When view is displayed w...
I have an AdminController protected by an Authorize attribute like this
[Authorize(Roles = "Admin")]
public class AdminController : BaseController
{
.....
}
And I have in my web.config this security location section
<location path="admin">
<system.webServer>
<security>
<authorization>
<remove users="*...
Dear Experts,
Is it possible to create a global action filter that will automatically apply to all actions in all controllers in ASP.NET MVC application? I want something like "before_filter" defined in ApplicationController in Ruby on Rails.
Thank you for your help.
...
Hi,
I'm trying to implement a custom user object in ASP.NET MVC 2. I've seen a solution where you can do some magic in Global.asax to turn Controller.User into another type, say CustomUser. But Controller.User is still an IPrincipal, which means I have to cast it to CustomUser every time I want to use it, and I don't like that at all.
...
According to the spec, complex child properties (aka "nested objects") are validated only if an input is found for one of the nested object's properties.
For example, if Person has properties { string Name, Address HomeAddress } and Address has properties { Street, City }, and an action accepts parameter of type Person, then Person.Home...
Trying to figure out which makes more sense
<%foreach (var item in Model.items)
{
%>
<tr>
<td>
<% if (!item.isMgmt)
{ %>
<a href="/MVC/AzureMail/Unfiled/<%:item.uName %>">
<%:item.uName%></a>
<% }
else
{ %>
<%:item.uName %>
<% } %>
</td>
</...
Hello,
Let's say I've this
public class OrganisationData
{
public NavigationData navigationData {get; set; }
}
Then
public class NavigationData
{
public string choice {get;set;}
//other properties omitted
}
I've this on my view
<% Using(Html.BeginForm()){%>
<p>
<% = Html.RadioButtonFor(x => x.organizationData.navig...
Hi. I want to be able to register scripts and stylesheets. These items would then be added to the head section of the current page. For example, I have a partial view called ImageViewer that renders a few images and relies on a script. Instead of adding this script in the view using the ImageViewer, I'd like to be able to register this s...
I have the following route:
routes.MapRoute(
"edit_product", // Route name
"Product/Edit/{productId}", // URL with parameters
new { controller = "Product", action = "Edit",
productId = UrlParameter.Optional } // Parameter defaults
);
Why does this code works...
I'm working on MVC project and i using jQuery in view page to get data from controller.
public JsonResult CheckUpdate()
{
dt = dt.AddSeconds(-100);
IQueryable<Tweet> _tweet = ttr.CheckTime(dt);
return Json(_tweet, JsonRequestBehavior.AllowGet);
}
This is a method in my controller which gets data back from the repository class ...
Is it possible to add routes to controllers defined in external assemblies? Everything I've seen so far doesn't seem to allow for it.
Based on the below help
I've added the following two routes as a test and no matter what I do it keeps defaulting to the "Default" route...however if I change the name of the "Browse" controller to the n...
Hello,
I'm having an issue where in my controller, I'm setting values in a collection and storing them in ViewData. eg:
ViewData["ex1"] = new SelectList(ex1); // a simple collection
ViewData["ex2"] = new SelectList(group.Members, "Id", "Gender");
I'm passing these to my View and looping through like this. eg:
<div id="divListBox" s...
I've been working with MVC 2 for awhile and ive done ReturnToAction as well as ValidationSummary - but this is a little different in that my "submit" buttons are controls by javascript/JQuery - i debug the action and it does go into the correct Controller Action but once it passes over RedirecToAction, nothing happens....
My second prob...
I have a scenario where I need the following functionality:
In View I have call as:
$.ajax({
type: "POST",
async: false,
dataType: 'json',
url: "ControllerA/ActionA",
data: { var1: some_value },
success: function (data) {
if (data == true) {
form.submit();
}
else if (data == fa...
I am just now starting to work with LINQ, and am pretty familiar with MVC. I have a strongly typed view that is updating a record. I have successfully done a creation:
This works fine, and creates a record in the database:
public ActionResult Create(TABLEMODEL tableModel)
{
DBDataContext db = new DBDataContext();
if (ModelState...
I have an MVC 2 project where I have my own *.mdf file in the App_Data directory. The *.mdf file contains my normal tables but not a users table.
Is it possible to add a Users table to my *.mdf file and work with that instead of the simple register form? (if so: how could this be done?)
Because I don't know how to do these things above...