asp.net-mvc

Best AJAX file uplaod control in asp.net mvc project

can any one guide me which file upload is best for me asp.net mvc project. ...

jQuery Flexigrid with ASP.NET MVC

I' trying to use Flexigrid with ASP.NET MVC. I need all the JSON type functionality(searching, sorting, find) except that I'm using foreach in my view and looping to generate the table rows. <table id="gllisting"> <% foreach (var item in Model) { %> <tr> <td> <%=...

ASP.NET MVC AJAX value not displaying

View: function success(arg) { var obj = arg.get_response().get_object(); if (obj.ErrorMessage === '') { var answer = document.createElement('div'); answer.appendChild(document.createTextNode(obj.Answer)); document.getElementById('answers').appendChild(answer); ...

Under ASP.Net MVC v1, is Page_Load called?

Hi, Stupid Monday morning basic/noob question... Is Page_Load generally called for an ASP.Net MVC app? We just have one page, Default.aspx.cs - which only seems to be called for / and not for any sub-paths, so I dont think it is generally called... Thanks for the reply - to clarify, what I want to do in the Page_Load is the security ...

Is it possible to integrate NUnit to Visual Studio 2010?

When I create a MVC web application in Visual Studio 2010 it offers also to create a testing project using one of framework from the list. But I have only VS built-in testing framework in it. Is it possible to add NUnit there? ...

How to get MVC action to return 404

I have an action that takes in a string that is used to retrieve some data. If this string results in no data being returned (maybe because it has been deleted), I want to return a 404 and display an error page. I currently just use return a special view that display a friendly error message specific to this action saying that the item...

asp.net MVC Partial Views how to initialise javascript

Hi, I have an edit form that uses an ajax form to submit to the controller. Depending on the data submitted I redirect the user to one of two pages (by returning a partial view). Both pages rely on javascript/jquery and neither use anything common between the pages. What is the best way to initialise these javascripts on each page? I k...

MVC giving 404 errors after VS2010 install and VS2008 rollback

I'm having a bit of a problem with an MVC 1.0 site and wondered if anyone could help. The site was fully working in Visual Studio 2008, but after an upgrade to VS2010 I am having problems. The steps I have taken so far are: Install VS2010 Upgrade my MVC site to .net 4.0/MVC 2.0, which generally worked Shelved all my changes Got latest ...

jquery-ui autocomplete with ASP MVC suggestions not displaying

I have been trying to get a simple example of the jquery-ui autocomplete to work. I have a controller setup to handle the query, and it returns the json that looks to be in order, but I am getting no suggestions showing up. Here are the js libraries I am including: <script type="text/javascript" language="javascript" src="/Script...

MVC 2 Client side validation is not working

Hi, I looked in all stack overflow threads, read all Scott guru posts, nothing helped me to solved the issue what am i do wrong? I've added the following js references : <script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> <script src="/Scripts/jquery.validate.js" type="text/javascript"></script> <script src="/Scr...

Debugging deployed azure app

Is it possible to attach to a deployed Azure app? I would like to be able to step through the code so that I can see what values are being set in a request to one of my web role actions. I have looked around and the only examples seem to be of debugging when the azure app is running on the local machine. ...

UpdateModel for arrays in FormCollection

Hi there If I have [0].propertyname, [1].propertyname, etc in my FormCollection how would I go about updating the model? if I do this: public ActionResult Edit(int id, FormCollection collection){ IList<SoilSamplingSubJob> sssj = orderRepository.FindSubOrders_collection(id); UpdateModel(sssj, collection.ToValueProvid...

prevent user to enter script tags in asp.net mvc view

i have a login view in asp.net-mvc. i want that user cannot able to enter tag in username or password field ...

Viewmodels and Models, howto split them up

Hello I'm using asp.net mvc 2 and I'm not sure howto structure the models and viewmodels. In the nerddinner there is only 1 of each. Shall I have only 1 viewmodel of each entity (?) and then have 1 model for each form-modifing viewpage? So that viewmodel contains like all it ever would need, like: PagedFoo FooClass ..., FooClass, Foowi...

Dropdown is staying on the screen when I hit breakpoints in JavaScript files. Why?

I'm using Visual Studio 2008 Professional Edition SP1 & IE8. When I hit a breakpoint in a JavaScript file that's triggered when an item in a dropdown is selected the dev environment takes focus, but the dropdown list is still visible, hovering over the code. This makes it very unreadable! Does anyone have any idea what's causing this? Or...

How do I get my asp.net MVC application to recognize the stylesheet on the live server?

Hello all, I've been building my sample asp.net application using VWD2008 and the development virtual server that comes with that. I got to the point that I want to make sure that the application behaves correctly on the live server, so I went ahead and published it. Everything seems to working great accept for the stylesheets. None of ...

C# and ASP.NET MVC: Using #if directive in a view

Hi all, I've got a conditional compilation symbol I'm using called "RELEASE", that I indicated in my project's properties in Visual Studio. I want some particular CSS to be applied to elements when the RELEASE symbol is defined, and I was trying to do that from the view, but it doesn't seem to be working. My view code looks like this (...

Vs2010 MvcBuildViews Not firing

This project in Vs2008 targeting .net 3.5 used to compile views. Vs2010 Targeting .net 4.0 the following view code is not picked up as an error, and I have not found anyway to listen to the mvcBuildview trace/debug output: <%{ %> A completely unmatched code block declaration is not being picked up, neither was a partial view inherit...

How do i set focus to a text box Html.TextBoxFor - mvc 2

Hi, I'm trying to set focus on a text box which generated in the following way: <%=Html.TextBoxFor(model => model.Email, new { style = "width:190px;Border:0px", maxsize = 190 })%> i tried to use javascript which didnt help much. var txtBox = document.getElementById("Email"); if (txtBox != null) txtBox.focus(); ...

ASP.NET MVC2, getJSON, Jquery Windows 7 64bit IIS

I have started learning MVC2. I developed a simple customer search screen with Jquery and Json calls. In debug mode everything works. When i deployed to my local iis server and after configuring the app pools i got the app to run. When i do the search nothing happens, it like the json call is not working and i dont get any errors eith...