asp.net-mvc

Getting the number of existing connections in WCF

Is it possible to check the number of existing available connections a wcf service has? programmatically? I want to see if connections to the web service were closed properly in the ASP.NET code. thanks ...

ASP.NET MVC 2 JSONP with MVC Futures

I´m using mvc futures 2 with WebApiEnabled for XML and JSON support. But due to cross domain issues with jQuery $.ajax I´m lookin in to JSONP. Is there a simple way to extend futures rest function for JSONP or should I do something else. Do anyone have some hints on this subject ? ...

DBNull values on an ASP.NET MVC view

I am writing a simple ASP.NET MVC web app. At this point, I am just trying to display a strongly typed DataSet on the automatically generated view. However, some of the values in the DataSet are null and cause exceptions. I am wondering how this simple scenario is handled by others. It seems excessive to sanitize all the values in the ...

ASP.NET MVC input is not a valid Base-64 string Error

Hello all, I am trying to post a from in an asp.net mvc page which contains files(user uploads) and a few string fields. However, when I click on the submit I get the following error; The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space charac...

Moq: Unable to cast to interface

Hello, earlier today I asked this question. So since moq creates it's own class from an interface I wasn't able to cast it to a different class. So it got me wondering what if I created a ICustomPrincipal and tried to cast to that. This is how my mocks look: var MockHttpContext = new Mock<HttpContextBase>(); var MockPrincipal = new ...

what architecture to use with asp.net mvc vd web forms

please explain how to get high capacity architectures with both the default asp.net web forms and mvc models with regard to being able to serve millions of page views. i want to know how to set up each model from DB clustering, to caching, logical/ physical tiers, load balancing iis servers, scaling out or up, session state management a...

Url routing suggestion in asp.net mvc.....

I have an action link in one of my view page <%=Html.ActionLink("Details", "Details", new { id = Model.Id })%> and redirects me to page which has a url like this http://localhost:1985/Materials/Details/2 instead of this i would like to have my url as http://localhost:1985/Materials/Details/steel material name instead of Id... Is this p...

Good IOC Frameworks to use with asp.net mvc?

Hi I am wondering what good simple IoC frameworks are there for asp.net mvc? that have good documentation and are just easy to get up and going. Thanks ...

'Details' in asp.net mvc routing doesn't seem to get removed....

I am trying to remove Details from http://localhost:1985/Materials/Details/2/Steel but some how my route doesn't seem to work... Edit: routes.MapRoute( "Materials", // <-- Above default "Materials/{id}/{name}", new { controller = "Materials", action = "Details", id = "", name = "" } ); ...

How can I use validation to enforce the uniqueness of a property in ASP.NET MVC 2?

Imagine an object with a field that can't have a duplicate value in the database. My first instinct was to create a unique attribute that I could apply as a data annotation to a property. This unique attribute would hit the database and check if the value already exists. This would work when executing a create method, but would fail on a...

ASP.NET MVC: Html.Actionlink() generates empty link.

Okay i'm experiencing some problems with the actionlink htmlhelper. I have some complicated routing as follows: routes.MapRoute("Groep_Dashboard_Route", // Route name "{EventName}/{GroupID}/Dashboard", // url with Paramters new {controller = "Group", action="Dashboard"}); ...

Proxy object references in MVC code

Hi there, I am just figuring out best practice with MVC now I have a project where we have chosen to use it in anger. My question is. If creating a list view which is bound to an IEnumerable is this bad practise? Would it be better to seperate the code generated by the WCF Service reference into a datastructure which essentially hold...

Return HTTP 404 when MVC2 view does not exist

Hi, I just need to have the a small CMS-like controller. The easiest way would be something like this: public class HomeController : Controller { public ActionResult View(string name) { if (!ViewExists(name)) return new HttpNotFoundResult(); return View(name); } private bool ViewExists(string na...

@ symbol for strings in jQuery

if (confirm('<%=Ns1.Ns2.MyClass.GetResourceText("DeleteConfirmationMessage")%>')) { /* something to do...*/ } I have a jQuery expression as above. But the return value of GetResourceText method is a very long string. So my page renders the function like below: if (confirm(' Are you sure lablabla? If you delete this lab...

How do I do a list of items in Jquery and get it on server side ?

I'm trying to make a list of items (telephones and dependents for a customer), for example, the user could include some number phones and remove others (maybe edit them if it is possible), like a list inside the record of customer. I'd like to know how can I do it on client side and get the list in server side ? Is there a jquery plugi...

Test Views in ASP.NET MVC2 (ala RSpec)

Hi, I am really missing heavily the ability to test Views independently of controllers. The way RSpec does it. What I want to do is to perform assertions on the rendered view (where no controller is involved!). In order to do so I should provide required Model, ViewData and maybe some details from HttpContextBase (when will we get rid ...

Asp.Net: Storing Principal in httpcontext.current.items

Hello, I was wondering if there are any downsides of storing a custom Principal in httpcontext.current.items instead of the httpcontext.current.user. I know you need to set it for each request but I have to do that with httpcontext.current.user also. thanks in advance, Pickels ...

How do i configure optional flags in MVC 1.0 routes

I want to configure a route with optional flags. E.g. I want to be able to call the products page and send optional filters (flags) for offers and in stock options. If the flags are NOT specified then all products should be returned. http://localhost/products http://localhost/products/onlyOnOffer http://localhost/products/onlyInStock...

How to do Custom Validation on Multiple Properties in ASP.NET MVC 2.0?

Basically, what the title says. I have several properties that combine together to really make one logical answer, and i would like to run a server-side validation code (that i write) which take these multiple fields into account and hook up to only one validation output/error message that users see on the webpage. I looked at scott gut...

jquery not working in internet explorer using mvc

i have a group of radio buttons that are generated on the fly from the db into a partial control then rendered on the page as html and they all have the same name now in firefox and chrome the following code works fine $(".FlightSelectedRadio").live('click', function() { alert("after flight select"); $("#ToisGarantueedBid").at...