asp.net-mvc

String to datetime

I have a string 12012009 input by the user in ASP.NET MVC application. I wanted to convert this to a DateTime. But if I do DateTime.TryParse("12012009", out outDateTime); it returns a false. So I tried to convert 12012009 to 12/01/2009 and then do DateTime.TryParse("12/01/2009", out outDateTime); which will work But I don't find any s...

asp.net mvc user control problem

User Control <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <% using (MvcApplication1.Models.EgovtDataContext _model = new MvcApplication1.Models.EgovtDataContext()) { %> <% foreach(var md in MvcApplication1.Models.) { %> <% if (md.ParentId == 0) { %> <% } %> <% } %> ...

window.location subject to querystring limitation

Edit: Thanks all for the help, rod. Hi All, $('#button1').click(function(){ window.location = "/Home/GetCustomers?" + $('#myForm').serialize(); }); Is using window.location subject to querystring size limitation? For instance, if my form has many parameters to serialize? Thanks, rodchar ...

RenderPartial cannot be converted to a string

I'm working with Telerik's MVC Tabstrip control and am having an issue, although I suspect the issue is more my ignorance of how to properly use Lambda expressions and MVC helpers and not really Telerik-specific. My helper call is this: <% Html.Telerik().TabStrip() .Name("BusinessDetailsTabs") .Items(parent => {...

asp.net mvc user control problem foreach loop

Previous post <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %> <% MvcApplication1.Models.FeaturesRepository _model = new MvcApplication1.Models.FeaturesRepository(); %> <% foreach (var md in _model.GetAllFeatures()) { %> <li><%= md.vcr_FeaturesName %></li> <% } %> It is with reference to the pre...

Collection of MVC CSS files available?

Just curious - are there various customized Site.css files (and accompanying images) that work with the default ASP.NET MVC 2 templates? I'm a stereotypical developer who "doesn't do pretty" so I'd like to find a design that is good enough for me to use until I later have a designer come back and fix my design. Are there collections/lib...

Vague MVC and Castle Windsor question. Sorry...

I have inheritted some code in which the MVC Controller classes all get their constructors called by Castle....DefaultProxyFactory.Create() somewhere along the line (the call stack drops out to the <external code>, which isn't helping.) So, basically, how would I go about finding out where Castle is being told how to call the constructo...

ASP.NET MVC: Triggering an action before posting to Paypal payment gateway

I'm in the middle of developing an e-commerce site that is using Paypal as it's payment gateway. All I want to do is run some code before the user heads off to Paypal to pay for their order, but I have no idea how to do it. The user should click a submit button, changes are made (in this case, the status of the order), and then the use...

asp .net mvc2. how to create a clone like tadalist

I am currently learning asp.net MVC2. I was trying to do a simple project similar to tadalist.com Could you please guide me to some articles on how to create the dynamic textboxes and how to capture the user input for persistance? Thanks ...

ASP.NET MVC: Route to URL

What's the easiest way to get the URL (relative or absolute) to a Route in MVC? I saw this code here on SO but it seems a little verbose and doesn't enumerate the RouteTable. Example: List<string> urlList = new List<string>(); urlList.Add(GetUrl(new { controller = "Help", action = "Edit" })); urlList.Add(GetUrl(new { controller = "Help...

Is it possible to use Dependency Injection/IoC on an ASP.NET MVC FilterAttribute ?

Hi folks, I've got a simple custom FilterAttribute which I use decorate various ActionMethods. eg. [AcceptVerbs(HttpVerbs.Get)] [MyCustomFilter] public ActionResult Bar(...) { ... } Now, I wish to add some logging to this CustomFilter Action .. so being a good boy, I'm using DI/IoC ... and as such wish to use this pattern for my cus...

How to read modelstate errors when returned by Json?

How can I display modelstate errors returned by Json ? I want to do somthing like that... if (!ValidateLogOn(Name, currentPassword)) { ModelState.AddModelError("_FORM", "Username or password is incorrect."); //Return a json object to the javascript return Json(new { ModelS...

ASP.NET custom routes for simple requirements management tool

I am implementing a very simple requirements management tool. I want the URLs to look like this: Shows home page for "Project One": http://projectmanager/Project/Project%20One Shows a list of requirements being worked on for "Project One" http://projectmanager/Project/Project%20One/Requirements Shows requirement 1 for "Project One" ...

Long running operations (threads) in a web (asp.net) environment

I have an asp.net (mvc) web site. As the part of the functions I will have to support some long running operations, for example: Initiated from user: User can upload (xml) file to the server. On the server I need to extract file, do some manipulation (insert into the db) etc... This can take from one minute to ten minutes (or even more ...

How can we fill the select tag of html with json result in partialViews in asp.net MVC?

How can we fill the select tag of html with json result in partialViews in asp.net MVC? any article pls send the link? ...

How modify Details view

Part of my strongly typed Details view created in asp.net mvc: <fieldset > <legend>Fields</legend> <p> ArticleNumber: <%= Html.Encode(Model.ArticleNumber) %> </p> <p> CalCertificateFile: <%= Html.Encode(Model.CalCertificateFile) %> </p> </fieldset> I need modify this view to displa...

Controller class not available in Add View ASP.NET MVC

Hi I have created the following controller i want to add view that should have the data access class UserMagnament.Controller.menuitems but when i add view by right clicking on view folder,it is not showing "UserMagnament.Controller.menuitems" in add data class using System; using System.Collections.Generic; using System.Linq; using Sy...

ASP.NET MVC null ViewResult

How should one deal with an MVC controller returning a null ViewResult? As an example I am creating a simple edit view: public ActionResult Edit(int id) { var person = (from p in context.SWLiftShare_Persons where p.id == id select p).SingleOrDefault(); if (person != n...

Python code editor control for .NET MVC

I am using .NET MVC in an application that needs to have a IronPython code editor on a webpage. I am looking for some code editor that can provide line numbers and some syntax highlighting for the text area where the code is entered. Does anyone have any pointers? ...

Adding childs to list of parents with jquery /mvc2

Hi, I have a table of products on my page, each product has zero or more colors, the colors are shown as a list beneath the product. After the colors I have a button to add a color. The button will do an ajax call with the parent product id to a controller which will return a JSON object with color information. My problem is where to st...