asp.net-mvc

Convert an HTML button to ActionLink

I have an html button setup and functioning with a set range of required properties that I'd like to convert to a text-based link instead. Additionally, so I can familiarize myself with working html helpers and intellesense I'd like to see how to shoehorn these properties into an ActionLink: <input type="button" id="RemoveRegistration_S...

Html Helpers Help

Hi Can anyone recommend a good book or tutorial for learning about the HtmlHelper class, specifically methods Html.CheckBox() and Html.Radio()? ...

subsonic 3.0.0.3 multiple database connection failover

hi there, am using MVC and Subsonic 3.0.0.3 but i cant seem to pin down a specific point for multiple database connection. normally in normal .net i would have my 2 strings in the web.config file and have a database class for my project, within this db class i would do something like this: try { conn.ConnectionStr...

CheckBox Html Helpers

Hi, I have found a lot of tutorial on ASP.NET MVC. But most of the tutorials have skiped the use of check box and radio button html helpers. I need some tutorials on them. *** I have a field in Data model called "Checked". Now how can i verify that in my form view it is checked or unchecked? ...

Running order of static code

I am working on a project using .Net mvc. I have a csharp class containing both a static constructor and some static filed. private static Class1 obj1 = new Class1(); private static Class2 obj2 = new Class2(); static Foo() { Init(); } private static void Init() { obj1.DoSomething(); obj2...

asp.net MVC: localization

Hi, I have my target language in Session["lang"], which is either "en" or "it". I have added this to the Site.master: <script runat="server"> void Page_Load(object sender, EventArgs e) { string lang = Session["lang"].ToString(); System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpeci...

Make a dynamic query with Linq using a drop down list selected option in Asp.net MVC

Hi everyone! I'm trying to accomplish this with Linq to Sql and Asp.Net MVC: I have a Drop Down List with options Country, City and State. And beside it, there is a textbox. So, an user will, for instance, select City and will type "new york city" in the textbox and the application will show himm the results of his choice. So, how ca...

UpdateTargetId ASP.NET Ajax...Where is it?

Hello SO: This is probably a silly question, but why am I unable to utilize Ajax in my project? I should have all the necessary references: System System.Configuration System.Core System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Linq System.Drawing System.EnterpriseServices System.Runtime...

Action with set of fixed parameters in url and a set of optional parameters either from post or from querystring

In my route collection I have routes.MapRoute( "Recalculate", "{siteLanguage}/Formula.mvc/relcalculate/{identifierString}/{formulaId}/{wratio}/{customRecalcString}", new { controller = "Formula", action = "Recalculate", wratio = "", customRecalcString = "" } ); The action it maps to is public ActionResult Recalculate(string ide...

ASP.NET MVC & ASP.NET AJAX Toolkit AutoCompleteExtender

Can I make an ASP.NET AJAX AutoCompleteExtender use an ASP.NET MVC JsonResult rather than an ASMX Webservice? I've got an ASP.NET AJAX Toolkit AutoCompleteExtender on an ASP.NET MVC View. It uses an JsonResult type function in my MVC Controller. ASP.NET MVC View: <form runat="server"> <asp:ScriptManager ID="ScriptManager1...

NHibernate + ASP.NET MVC: model binder's session is closed

I use custom model binder to bind Order/OrderItem in my actions. This model binder uses ServiceLocator.Current.GetInstance(); where ICart in turn depends on IOrderRepository (not sure if this matters). Now, everything works fine when I create first order item. And when I create the second one. Then I try to display the order which now c...

Selecting Multiple Files for Upload in Web Page

I am building a file upload web page that has the capability to process multiple upload files. Ideally I would like to allow the user to select a folder and have the web page enumerate the files in the folder client-side, but I don't think that's possible without a browser plugin. Alternatively, would it be possible to allow the user t...

Is it possible to use a "complex" model with the Data Annotation Model Binder in asp.net mvc?

I am using the Data Annotation Validator, outlined here: http://www.asp.net/learn/mvc/tutorial-39-cs.aspx The Data Annotations Model Binder is on codeplex: http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24471 I've downloaded the code, built it, and referenced the new System.ComponentModel.DataAnnotations.dll. I've...

ASP.NET MVC - CKEditor Image Upload

I am looking to include CKEditor in a project I am working on and I need the image upload support provided by the CKFinder plugin, however I do not particularly need the rest of the CKFinder tool and thus purchasing a license is a little overkill. Has anyone taken the time to implement a custom image uploader for CKEditor 3 that will wor...

ASP.NET MVC Updatemodel not updating but not throwing error

Any ideas why this doesn't update but doesn't throw an error? public ActionResult Edit(int id, [Bind(Exclude = "deptid")]FormCollection collection) { var department = _repository.ListOne(id); //Grabs record from linq to sql try { UpdateModel(department); _entities.SubmitChanges(); ...

ValidateInput Attribute Doesn't Seem To Work in ASP.NET MVC

I'm trying to get around the "potentially dangerous Request.Form value" error and I'm having no luck. Yes, yes, I've read all the other StackOverflow related questions and none of them seem to get me closer to an answer. I am using [ValidateInput(false)] on all related controller actions...and I've checked many times. I'm using Valida...

How do I access the strongly typed view Model inside of javascript?

I noticed if I start doing this: var companyID = <% %>; I don't get any intellisense letting me access my Model.object that the view is suppose to have available to me since it is strongly typed. What am I missing here? ...

Speeding up ASP MVC Unit Tests

How do people run their automated tests for ASP MVC ? Currently we're using native Visual Studio unit tests and running them linearly on a single machine. They're too slow to be useful currently. Switching to nunit? Distributing the unit tests with Incredibuild XGE? Anyone tried these or have other ideas? Thanks. ...

page does not run jquery script on load

I have an ASP.net mvc page that executes a jquery script on load. The script calls an action on a controller and hydrates a dropdown list. this works on my dev machine but when deployed to the webserver (Win 2k3 box running IIS 6) the page loads but it does not run the script resulting in an empty drop down list. I have the jquery-1.3....

Posting to a page, can I access querystring values?

In my asp.net-mvc application, I have a action method that I marked with the ActionVerb=POST. When I do that, can I still access the querystring or only request.form values? ...