asp.net-mvc

.NET MVC Masking Password textboxes

I was under the impression that using an annotation like this: <Required()> <DisplayName("Choose a Password:")> <ValidatePasswordLength()> <DataType(DataType.Password)> Public Property Password As String Would create a masked field when used in the view: <%: Html.TextBoxFor(Function(model) model.Password) %> <%: Html.ValidationMessag...

Can I disable a drop down list without using disable in javascript?

I have a drop down list that gets enabled/disabled based on a checkbox onclick. On my debugging my object reference is not set when my checkbox is disabled in my controller. CONTROLLER Subject = Request.Form["DetailSelect" + rowID].ToString(); JAVASCRIPT ddlSelect.disabled = !ddlSelect.disabled; ASPX <select = i...

How would I create an object, redirect to another controller to retrieve a value, then return to Create() action and set that value?

I call Create() which puts an object in session and returns a view. On that view is a button to "Add Item", which redirects to another controller, they select and item, and that id is returned to the first controller. But I can't return to the same Create() method since that puts a new object in session, overwriting any changes they ma...

jQuery Ajax Memory Leaks

I've seen some other posts on this, but it appears that when i do ajax calls with jquery over and over again (every 30 seconds in my case), I get a memory leak. Changing from a $get to a $post (whilst more secure as well) cuts down on the size - it still happens. Even if I do NOTHING in the response. Any ideas anyone? EDIT: Here is ...

ASP MVC 2: Jquery modal popup, how to return data

Hey I'm looking into adding a jquery modal popup to my mvc project. I have been looking at http://www.weirdlover.com/2010/05/20/mvc-render-partial-modal-pop-up-via-jquery-and-colorbox-demo/ posting. My scenario: I have a page with a few input fields (textbox, checkbox). I want to have a link that will open a modal popup to select an ...

How unit testing is better in ASP.NET MVC than Web Forms?

I have just started to learn ASP.NET MVC. When comparing ASP.NET MVC with Web Forms one of the main advantage of MVC is always told to be better support of Unit Testing. Can I got a good explanation of how it has better support? Edit : If possible please provide example in both. ...

Session is NULL when running ASP.NET MVC inside of ASP.NET

If I create an ASP.NET Web Application project and then add an ASP.NET MVC 2 to it using the default routes defined like so routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { action = "Index", id = UrlParameter.Optional } ); The Sessi...

what is the best way to do server side asp.net mvc filtering of jqgrid

I have an action that is tied to jqgrid filtering. right now i have something like this. public ActionResult GridData(GridData args) { IEnumerable<Car> car = model.GetCars(); // now i need to filter and return a Json object. } In my case i have a collection or car objects. Is there best practi...

ASP.NET MVC on IIS 6 problems

I am trying to get MVC to work on IIS6 and am having issues. I went through the steps on Haaked http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx I am trying to get the IIS6 Extension-less URLs to work I have done the steps,and when I navigate to my site I get this error: Could not load file or assembly '...

Debugging a mysterious IIS crash

I have an ASP.NET MVC web application which integrates a C# managed library of ours that loads unmanaged plugins to do some file processing. These unmanaged plugins in-turn rely on a few 3rd party libraries to do their dirty work; some of which are causing IIS to crash. We use the exact same library in a desktop application which is abl...

How to Optimize Combres Settings (Compression, Minification)

Can anybody tell me the most optimal Combres settings? I've got the following but it appears as though my CSS and my JS are not being minified. <?xml version="1.0" encoding="utf-8" ?> <combres xmlns='urn:combres'> <filters> <filter type="Combres.Filters.FixUrlsInCssFilter, Combres" /> <filter type="Combres.Filters.D...

Application not connection to sqlserver outside the firewall.

So I have an application that connects to our SQLServer. This works on any server behind the firewall just fine. When i put it out on our live server, outside the firewall the connection to the sqlserver fails with this error A network-related or instance-specific error occurred while establishing a connection to SQL Server. The serve...

Asp.Net MVC FormsAuthenticationTicket

Hi, Im setting FormsAuthenticationTicket in the Logon method to manually create an authentication cookie. How do I validate that authentication cookie and assign it the Current.User object. Is it done in the Global.asax page? Logon code: FormsAuthenticationTicket Authticket = new FormsAuthenticationTic...

Is ASP.NET MVC definition of an AJAX success to narrow? how do i deal with other status codes?

I am using Ajax.BeginForm(... in asp.net MVC 2.0 I would like to return HTTP status codes from my controller. For example: 400 (validation error) 200 (if everything is OK) I would like to use new AjaxOptions{UpdateTargetID="ajax-form", OnSuccess="...", OnFailure="..."} to handle these scenarios, however If I return a statuscode ...

Complicated Module Based Create new Record in DB with ASP.NET MVC 2

Hi, i have a very tough problem for me to solve, and i thought and searched alot and came down t one conclusion which i will mention down. the problem is i have a client that wants to create a websites based on a Common functionality, so let us call it Modules, so what i thought is to use MVC Contrib Portable Areas, which are great ideas...

Session that never expires like on stackoverflow.com, unless the user clicks logout

I am building a asp.net mvc application. I want session to never expire, once the user login, unless the user clicks on logout. Whats the best way of doing it? I have used FormsAuthentication.SetAuthCookie(userName, createPersistentCookie); and set createPersistentCookie to true, but still I get logged out after sometime. ...

Can't show views every time when select value on drop down list

Select group <%=Html.DropDownList("GroupsDropDownLst", (IEnumerable<SelectListItem>)ViewData["GroupsDropDownLst"])%> <fieldset> <legend>Devices And Accessories</legend> <p>Devices:</p> <%= Html.Action("ReadXMLDevices", "ImportXML", new { groupID = Html.Encode(ViewData["GroupsDropDownLst"]) })%> <p>Accessor...

ASP.NET MVC 2 RenderAction Validation is not working

Hi, i have a very strange problem, i have a main controller with it's own model, and in the Create new Record View, inside the Form i call RenderAction to render an ASCX View with it is own Dedicated Model and controller, the problem is that that when i submit the form the validation is only taking place on the Main Model and it is not ...

MVC ViewData not rendering in View.

I have the following code in my post action method for Edit. JobCardService.Update(viewData.JobCard); var js = new JavaScriptSerializer(); ViewData["Notifications"] = js.Serialize(new {NoteificationType = "Success", Message = "The installtion was successfully updated"}); return RedirectT...

Is it possible to get postback effect (like in ASP.NET Webform) with dropdownlist without javascript?

Hello, I'd like to know if it's possible to get postback effect like in ASP.NET webform without using JavaScript. I've a collection of object to display on the view. I'd like to place a dropdownList element somewhere on that view, such as, if I select a different item, then the postback occures and a new filtered collection is sent to ...