asp.net-mvc-2

File path in asp.net mvc application with jquery file tree

I'm trying to get a grip on the jquery file tree plugin, and I have a problem with file paths. The thing is, the jquery call sets a root directory, and if it is set to "/" I want it to be a path in my server directory. So I set this in the server code that the jquery code interacts with. Here's the jquery call: <script type="text/javas...

How do I make globalization work with MVC2 and jquery?

Hi, I am trying out some globalization in an asp.net mvc2 application but can't get it to work fully. I am using the library http://github.com/nje/jquery-glob as a tool to display currency and dates etc according to user wishes. However something is bothering me a little. IU can't get the client / server side validation to actually acce...

aspnetdb.mdf and Microsoft.ACE.OLEDB.12.0

I'm trying to run my asp.net application on a windows machine (XP SP3, Vista, 7) which has only Microsoft.ACE.OLEDB.12.0 as the database engine installed and need to connect to the standard aspnetdb.mdf user database. Does any one know it is possible to use a connection string that works with mdf files in such a condition? I used connec...

ASP.NET MVC 2 - Problem with Request encoding

Hello! There is a controller and an action which receives one param through GET, approximately here so: www.site.com/controller/action/?query=параметр <- Russian word Problem: Example 1: www.site.com/controller/action/?query=Пример <- Russian word Example 2: www.site.com/controller/action/?query=Example Reading param: var param = ...

ASP.NET Auth Cookie on Sub Domain

Hi. I have my site setup like this: www.mysite.com subdomain.mysite.com (configured as an application) I then registered another domain, lets call it www.myothersite.com which redirects to subdomain.mysite.com using masking so that the address always remains www.myothersite.com/... Within the subdomain site I have a forms authenticati...

MVC2 - Basic question where logic should go

Starting with MVC2, messing around with a simple db and just using the index view to display the items like: in the controller: // // GET: /Equipment/ public ActionResult Index() { return View(database.Artists.ToList()); } then the auto generated code in the view: <td> <%: item.ArtistID %> </td> ...

asp.net MVC 2 - most elegant way of isolating guard code - guarding against null controller parameters

Hi all I have a very simple problem, but I'm looking for the 'best' solution to the following: I have multiple controller actions something like this: public ActionResult DoSomething(PackageViewModel packageByName, DoSomethingInputModel inputModel) { if (packageByName == null) { Response.StatusCode = 404; Respon...

asp.net mvc 2 custom templates

Hi, I am trying to use custom templates of ASP.NET MVC2. But it does not show any content in my defined template. Here's my code description I have a controller called TestController. and I create a view for Create action and I wrote following code in the view just created. <%: Html.EditorForModel() %> Then I create add a new web us...

how asp.net mvc globalization work with my own ResourceProvider

i create a new class which inherite the IResourceProvider,and register it in web.config <globalization resourceProviderFactoryType="xx.xxx.xxxx" uiCulture="auto" enableClientBasedCulture="true"/> this new class just implement public GetObject(string resourceKey, CultureInfo culture) { .... } which will get globalization text fr...

More Ajax / MVC weirdness

I've been puzzling over some odd behaviour with my MVC2 project for the last few nights. I have an MVC action result that accepts a project ID and a complex Json object, looking like this: [HttpPost] public JsonResult AddStory(int projectid, Story story) { try { Project prj = repository.Single(p => p.ID == projectid); ...

How to search in returned json result

I am trying to find away to search in returned json result. the returned result like : {"Result":["Css","java","jquery","asp.net","mvc","javascript","asp","c#"]} I want to get all the words that starts with "j" in an array or another json object. ...

can someone explain this to me

Times Refers to the start + stop date For each user assigned to a timeslice, create a reference record here of UserId + Time. What does the bolded mean? I know this is a noob question, sorry. ...

MVC 2 JSON equivalent to FormCollection

Is there a JSON equivalent for FormCollection form as a POST action parameter? I have a dynamically generated number of fields that I need to post back via JSON. ...

ASP.NET MVC2 Edit action is adding a new entry to the database

Good morning, I'm learning MVC using the music store examples on the www.asp.net/mvc page, and I am having a problem with my edit action adding a new entry into the database instead of updating the existing entry. Here is my Edit action and the HTTPPost Edit. // // GET: /HomeScroller/Edit/5 public ActionResult Edit(int...

Implement Oberver Pattern using ASP.NET MVC

I need to implement Observer Pattern in ASP.NET MVC. Can anyone guide me where I can find the skeleton of the classes for this or can provide me a skeleton itself? I need to apply this pattern with the clear separation of model, view and controller. Thanks. ...

Ajax.BeginForm not working

The following code does not work: <h2>Admit</h2> <br /> <div> <% using(Ajax.BeginForm("Find", "XYZ", new AjaxOptions { UpdateTargetId = "results" })) %> <% { %> <%= Html.TextBox("query", null, new { size = 40 }) %> <input type="submit" value="Submit" /> <% } %> </div> <div id="results"> Results here.... </div> while the...

MsBuild and MsDeploy with multiple environments

Are there good patterns for mapping solution configurations to environments and using MsDeploy for packaging per environment? Shortest version: Grab this file, and try to change the .msbuild file so that a package is created. Details I have a solution with a large number of libraries and an ASP.NET MVC application. I drive the build...

Pass parameter from view to controller via jquery in MVC 2

I need to pass a url string from the view to the controller, a url that is retrieved via jquery. I tried just using the id parameter in the default routing, but that didn't work. It didn't accept a url string. Calling the Controller through jquery works fine, like this: $('#result').load('Home/Files/' + url); This calls the correct a...

Injecting Repository In MembershipProvider.Initialize()? Bad Idea?

I am building an asp.net MVC2 web app using StructureMap. I have created a custom MembershipProvider. I get it properly initialized at startup by calling: x.For<MembershipProvider>().Use(Membership.Provider); x.For<IMembershipProvider>().Use<CPOPMembershipProvider>(); In Initialize(), I am thinking of instantiating a repository to use...

ASP MVC Checkbox checked state bound to value on render

Hi, I'm new to MVC. I've got this all working nicely except when the page loads the checkbox is not set to the value of the object from the model. I am certainly missing something simple - hope you can point it out to me. I'm using a ViewModel class for the view, so my view page has this code: <%: Html.CheckBox("IsX", Model.Contact....