asp.net-mvc

Plugin controllers, StructureMap and ASP.NET MVC

I'm using ASP.NET MVC (1.0) and StructureMap (2.5.3), I'm doing a plugin feature where dll's with controller are to be picked up in a folder. I register the controllers with SM (I am able to pick it up afterwards, so I know it's in there) foreach (string file in path) { var assy = System.Reflection.Assembly.LoadFile(file); Scan(...

How does MVC Invoke an Action and map Request.Form to it's Parameters

I need to create something similar to how MVC invokes an Method(Action) and also uses the Model Binder to map a NamedValueCollection to the parameters on that method. Basically I have a Controller action that needs to dynamically call a method on a class, the controller has any information sent in a form or query string plus the name of ...

How to change the separator for group data in formCollection in MVC view?

Suppose I have a form in view with dynamic row with fields bound to viewmodel like: <%for (int i = 1; i <= 5; i++) { %> <tr> <td style="width: 100%"> <%= Html.TextBox("Link", Model.Websites[i.ToString()].Links)%> </td> ..... </tr> <%} %> When the form is posted, in FormCollection, all data coming from Te...

How to ensure HTTPContext has value?

I am building a version of the MVC Storefront. I have two themes, one is the standard ui, and the other is the admin ui. I have some HTML Helper methods, which deliver .ascx files to the .aspx files just like the example, but without plug-ins. All the stuff works on the default theme, but none of it works in the admin theme. I always ge...

Deploying ASP.NET MVC application in Visual Studio 2008

Can I use the Copy Web Site tool in Visual Studio 2008 to deploy MVC application to my hosting server? However, the Web Site menu doesn't even show up in Visual Studio with MVC project opened. What's the best practice to deploy MVC application? Thanks. ...

jQuery submit a form and its model to the controller

I would like to submit a form using jQuery and submit it to a controller action for processing, to include all the model properties, is this possible? ...

how to get checkbox status in from MVC view using jquery

There is a checkbox created by html helper in MVC view: <%= Html.CheckBox("Choice", false)%> Then Want to get the checking status of this this checkbox in js using jquery, how to write the code? ...

ASP.NET MVC UpdateModel vulnerable to hacking?

I have an ASP.NET MVC application that is calendar-like. As per the NerdDinner example, I'm updating the results of my edit page using UpdateMethod() In my app, certain events are fully customizable and certain ones are only partially customizable. Even though the edit form for editing the partially customizable events only have those f...

Is Performance of Storing Email in Pickup Directory similar to Asynchronous Sending?

ASP.NET MVC 1 doesn't support asynchronous threads spawned inside of a controller (yet, there is stuff in the Futures assembly and MVC 2 Preview, but nothing in production level release). However, I want to send my email asynchronously and I'm currently exploring options to do so. Once seemingly easy option, instead of actually sending ...

Can a asp.net mvc view page have a webform control on it?

Can a asp.net mvc view page have a webform control on it? I think I read about it before, but I'm not sure how it would work since MVC doesn't use viewstate etc? ...

Adding more files to the ClientBin for Silverlight in an ASP.net MVC app

I have an asp.net MVC app that also has a silverlight project for some sprinkled in effects and functionality... I just added a new file to my silverlight project and am at a loss in how to migrate it over to the clientbin in the MVC application ...

How to get User.Identity.Name from a controller?

Hi I want to have some viewData info across all my views so I am following this tutorial http://www.asp.net/LEARN/mvc/tutorial-13-cs.aspx So I made my own applicationController but I need to get the UserName from the user. Yet when I do this "HttpContext.User.Identity.Name" in the constructor it is always null. I am not sure why thou...

Html helper method not outputting results in mvc view page

Hi, My helper looks like: public static string OutputBlah( this HtmlHelper helper ) { return htmlWriter.InnerWriter.ToString(); } then in my viewpage: <%= MyHelpers.OutputBlah() %> Should this be working or am I missing something? Error says that there is no overload that accepts 0 arguements. What should I be passing into my m...

To Cache or not to cache? And how to cache it on a base controller in asp.net mvc?

I am making my own base controller since I want to pass some data to a master page. Now since this is like adding this code to every view in that controller it gets run every time. By the time it loads up the first time I think it has hit my code at least twice. So I was thinking about caching it. But in my book it says don't cache priv...

Fluent NHibernate HasManyToMany only works on first load

This is a weird one for me. I have a simple domain with 2 entities Company and Carrier. They have a m:m relation via another table. I set up my Fluent mappings as so public partial class Carrier { public virtual int ID { get; set; } public virtual string Name { get; set; } public virtual IList<Company> Companie...

<%=html.checkbox("Name", boolean)%> checkbox doesn't get checked

Why is the checkbox not checked with this code? <td><%=Html.CheckBox("ItemIsActive", item.ItemIsActive)%></td> Item.ItemIsActive is of type boolean and set to true? When i do this, it shows "true" in the view <td><%=item.ItemIsActive%></td> ...

ASP.Net MVC - Is it posible to gzip before putting data in cache

Hi guys Just wondering if anyone knows whether its possible to gzip results before putting the data in the cache...Note I am wanting to use a CompressAttribute I have and the built-in OutputCacheAttribute. I'm pretty sure its possible, because I have heard Jeff A. talking about it on a couple of podcasts... I know I can sort of change...

Model Binding an IList of selected items only

I have an action method setup: public ActionResult Delete(IList<Product> products) And a table of products in my view. I have got Model Binding working so that on submit I can populate the products list. But I would like to populate it with only the products that are selected via a checkbox. I think I could do it by changing the acti...

ASP.NET MVC - How to Redirect Secure?

I have an MVC app that is working fine, but I now want to add in an SSL site to the app. This is a separate site in IIS, with the SSL certificate, but for re-use, I'm just pointing the SSL site to the same directory as the regular site. What I'd like to do now, is direct the user to a certain controller (payment) if they come in on the...

open id implementaion as in stackoverflow

I am looking for a sample code/implementation of open id as in stackoverflow. I need to implement open id in my MVC C# application to allow my users to login with their google, yahoo, AOL,.. accounts. Please suggest me a good reference. ...