I have a strange issue with an Asp.NET MVC application.
Using Asp.NET MVC 3 Preview 1 on IIS 7.5 - Integrated
After building the application everything runs fine. Then after some random amount of time (or sometimes after updating a view or js file) the application dies.
Meaning, requesting the root page, I get the 403 error and reques...
I'm having some issues catching error messages from a controller via .ajax error. The script is called by a jQuery UI Dialog popup. Any help would be appreciated.
Here's the code snippet from my controller
Response.StatusCode = (int)HttpStatusCode.BadRequest;
return Content("There was an error in your request.",...
I need to capture user's X.509 certificates from their cards and map to a user table for forms authentication in ASP.NET MVC. I have created an MVC (ver 2) project in VS 2008, configured to run as a virtual directory under the Default Web Site in the local IIS on Vista using the default template but added RequireHttpsAttribute to the Ac...
I'm having trouble in validating a jQuery UI dialog using Jquery Validate upon clicking Save.
Here's my code to create Jquery dialog. It loads the dialog from a target a href URL:
$(document).ready(dialogForms);
function dialogForms() {
$('a.dialog-form').click(function() {
var a = $(this);
$.get(a.attr('href'),function(resp...
Does anyone can give any sample on using the paypal express payment feature with asp.net mvc2?
thanks
...
In MVC, is it possible to pass an array of string (List<string>) from C# code to viewdata and then retrieve the value in the view? e.g:
C#:
List<string> names = new List<string>();
names.Add("a");
names.Add("b");
ViewData["names"] = names;
MVC view:
<script type="text/javascript">
var nameList = '<%= ViewData["names"] %>';
</script>...
In action I taken some data from db.
Now in view I want to take value from one field which is referenced from other table with lazyload, by I get this error:
Could not initialize proxy - no Session
I wonder what I can do now.
public ActionResult Index()
{
using (NHUnitOfWork.Start())
{
va...
I am using MVC 2.
I have a BaseController class that every Controller uses. In this base controller class there is a property called IsAdministrator. I need to use this method in my view's HTML part. How would I do this?
EDIT:
My property in my BaseController is defined like this:
public bool IsAdministratorUser
{
get { return ...
I've made a simple hello world project in asp.net mvc2,3 aspx and 3 razor and benchmarked them. What I see is:
asp.net mvc 2 aspx : 4200 request per second
asp.net mvc 3 aspx : 3200 request per second
asp.net mvc 3 razor : 1700 request per second
What's wrong with razor, it's so slow?
Update:
I've redone the test. All 4 test virtual...
at the moment I have this:
in the ViewModel:
[MyCustom(Foo = 23)]
public int CountryId { get; set; }
in the Editor template:
<%= Html.TextBox("", Model) %>
how can I get the value (Foo=23) from my custom attribute (MyCustom) into the editor template ?
...
Is there any way to have a drop-down list in which non of the items are selectable? So basically, I'm just looking to use it as a way of showing/hiding a list. I don't want any hover highlighting and I don't want to be able to change the selected item.
Could you suggest if this is possible, or if anyone has any other ideas to achieve so...
Currently im using EF and using its datacontext directly in all of my actions, but since i started reading about loose coupling and testability im thinking that thats not the best way to go. Im trying to understand all the pro's and con's before i start refactor all my current code.
Problem 1:
Considering that every entity needs its own...
I wanted to create an editor template for a field type that is represented as a dropdownlist. In the definition of the editor template I would like to populate the DropDownList using a call to an action on the controller returning the results as JSON - Any ideas how to do this?
E.g something like:
<%@ Control Language="C#" Inherits="S...
I have an ASP.NET MVC 2 application with a custom StructureMap controller factory to handle dependency injection for my controllers:
public class StructureMapControllerFactory : DefaultControllerFactory
{
public override IController CreateController(RequestContext context, string controllerName)
{
Type controllerType = b...
My application
I have an application design that looks like this:
web application layer - asp.net MVC app with controllers and views that use POCOs and call services
service layer - business processes that use POCOs and call repositories
data layer - repositories that use POCOs and communicate with the model in the form of EF model wh...
I have a tree layered app
web app (asp.net mvc for simplicity here),
business services
data repositories
And I know there are four types of integration tests:
top down
bottom up
sandwich (combination of the top two)
big bang
I know I would write big-bang tests just like unit tests but without any mocking so I would employ a backe...
I want to be able to add/update/delete rewrite rules from the web.config.
Is this possible and are there any gotchas?
...
in my Model I have a string property Feeds with value like that:
<img src="/Images/Company/twitter.png" style="border:0; vertical-align:text-bottom;"/> <b>9/29/2010 1:01:33 PM</b><br/>How to get started building rich #VS2010 #VSPackage based extensions - <a href="http://bit.ly/a8ksc1" target="_NEW">http://bit.ly/a8ksc1</a><...
While there are similar questions here, none gave a complete answer, so I am posting a new one.
I have a paged grid - jqgrid - which receives data from server by ajax, N rows (10, 20 and so on, depending on the user selection) each time. There is a boolean value in the grid row model, which is transformed into a checkbox in the displaye...
I have a form which contains a whole bunch of checkboxes and some other types of control too. I need to retrieve the names of each selected checkbox.
What is the best way to do this? Can I do it with a linq query maybe?
So in pseudocode, I'm looking to do something like this:
var names = formCollection
.Where(c => c is ...