asp.net-mvc

How to test business logic (Doman Model Rules) while using ADO.net entity framework?

I am trying to test that the business rule of not allowing to share the same space with a user twice. Below is the method being tested. The line having the issue is marked below. public void ShareSpace(string spaceToShare,string emailToShareIt) { SharedSpace shareSpace = new SharedSpace(); shareSpace.InvitationCode = Guid.NewGuid()...

function.createdelegate

how can i call 2 methods using function.createdelgate() lik i'm having 2 methods (method_one and method_two) Function.CreateDelegate(this,method_one); but i need to call both the methods in it... ...

ASP.NET MVC 2 Preview 2 - display directory list rather than home/index

I just download ASP.NET MVC 2 Preview 2, create a new project and run it. But why it displays a directory list rather than default page ? I'm using VS2008 SP1 and ASP.NET MVC 1 installed. ...

Will the Spark view engine interoperate with webforms master pages?

I really like Spark, but we've already got a big investment in webforms based views. I'd like to start using Spark without having to convert all my existing views up front. The only problem I have with getting Spark working side by side with webforms is the master pages. Currenly I have spark layouts that are 1 for 1 duplicates of t...

Can you create an ASP.NET MVC website without the project?

Hi Is it possible to create a MVC website without having to create a MVC web application via Visual Studio? Basically I just want it to be a simple website and not to have to recompile it in VS. I want to develop it as a 'Web Site' on a test server and connect with front page extensions in VS express. If I copy the files from a MVC Appl...

Sample for Full Calendar in jquery

I am trying to integrate the jquery Full Calendar (http://arshaw.com/fullcalendar/) in my asp.net mvc application. I need to use this full calendar to add/edit/delete/show the events using the sql server database as backend. Do anyone have the sample code to implement the add/edit/delete events with this Full Calendar.? ...

ASP.NET MVC IIS problem

I have this piece of code in a .cs file in an ASP.NET MVC application: HtmlTableCell r2c1 = new HtmlTableCell(); r2.Cells.Add(r2c1); r2c1.ColSpan = 2; r2c1.Style.Add("font", "1px arial"); r2c1.Style.Add("height", "10px"); r2c1.Style.Add("background-image", "url(/Content/Images/pagebgbottomwhite.jpg)"); r2c1.Style.Add("background-repeat"...

How to get an ASP.NET MVC Ajax response to redirect to new page instead of inserting view into UpdateTargetId?

I am using the Ajax.BeginForm to create a form the will do an ajax postback to a certain controller action and then if the action is successful, the user should get redirected to another page (if the action fails then a status message gets displayed using the AjaxOptions UpdateTargetId). using (Ajax.BeginForm("Delete", null, new...

Fetch rows before and after the actual item using LINQ

I currently have a controller with the following ActionResult public ActionResult Details(string sku) { Product p = _productRepository.GetProduct(sku); return View("Details", p); } I would like to expand on the LINQ query to return the product before as well as the product after to the view. So instead of ...

asp.net MVC with LDAP

We are in our intranet using LDAP and config files in our asp.net pages to specify access to the pages. I want to use asp.net mvc for all new pages, but I have not idea on how I can specify the access level with asp.net mvc. Lets say that I have two controllers foo and bar. How can I configure asp.net mvc to let an users that belongs to ...

Mixing object props and strings in a List<object>

working in .net mvc I have a jQuery plugin consuming a List column for column where the controller outputs: usersData.Add(new List<object> { user.ID, user.FullName, user.Email, user.Company.Name, user.DateCreated.ToString(), ...

Where does ASP.NET MVC fall short against Ruby on Rails, CakePHP, et. al.?

I've been working quite extensively with ASP.NET MVC and I find it extremely useful (compared to WebForms), however I have some experience with other MVC frameworks and I feel there are definite gaps in capability. For one, in Drupal you can hook into just about anything and override it's View action. e.g. You can hook into the Drupal f...

ASP.NET MVC Action Method Parameters from Querystring don't change after first request

I have an action method in a controller that needs to do paging. I am passing a page number and pagesize parameter in the querystring. The problem I am having is that the first request I make sets the parameters for all subsequent calls. public ActionResult GetStuff(string key, int? page, int? pageSize) { // do something magical } M...

Asp.net MVC database connection setting in Visual studio 2008

I am trying to learn Asp.net MVC framework. I was looking at the video tutorial at the link below http://www.asp.net/learn/mvc-videos/video-395.aspx In this video the very first step is to add a new database to the example application. I have visual studio installed on my development machine but the SqlServer Express is running on a diff...

How do I block requests for all *.php, *.cgi, etc. pages from inside an ASP.NET MVC 1.0 app hosted in IIS7?

I'd like to block requests to any .php or .cgi regardless of the pathing information. For example, when the following url is used: http://mysite/Admin/Scripts/Setup.php It matches an existing route: routeCollection.MapRoute("Admin", "admin/{controller}/{action}/{uid}/{*pathInfo}", new { controller = "Admin", action = "Index", u...

Can someone help me understand why an auto-identity (int) is bad when using NHibernate?

I've been seeing a lot of commentary (from an NHibernate perspective) about using Guid as opposed to an int (and presumably auto-id in the database), with the conclusion that using auto-identity breaks the UoW pattern. This post has a short description of the issue, but it doesn't really tell me "why" it breaks the pattern (unless I'm m...

Should MVC 2 - Preview release be easily upgraded to Beta when it's released?

Should I just be able to install the beta on top of this without problems when it is released ? Not sure how it is treated within the visual studio environment. I'm thinking with it being a type of project in VS it should be ok. Can anyone clarify? MVC 2 is looking to be rather good from what I heard from Scott Gu @ the Manchester co...

ASP.NET MVC Ajax post to Action requiring authentication returns login view when user session has timed out

I am using the Ajax.BeginForm to create a form the will do an ajax postback to a certain controller action and then the response view is inserted into the UpdateTargetId. using (Ajax.BeginForm("Save", null, new { userId = Model.UserId }, new AjaxOptions { UpdateTargetId = "UserForm" }, new { name = "SaveForm", ...

ASP.NET MVC + Oracle: samples and how-to

While reading NerdDinner, and browsing other examples on the internet regarding ASP.NET MVC with LINQ To SQL. In my ASP.NET MVC project I have to connect to an Oracle database. The main goal of the application is to display, edit, and update data. I am uncertain if ASP.NET MVC can work with an Oracle database. Has anyone ever don...

Is a sharepoint developer technically "equipped" to do custom app dev and vise-versa?

This may be an opinion based question, but it's something that I wanted to ask (even if it does end up getting closed or deleted). I do custom app dev (asp.net/aspMVC) and have absolutely no knowledge about sharepoint and was wondering: If you have a "rock solid" custom app dev, asp.net/aspMVC web developer can he jump into sharepoint ...