mvc

Not display/write specific html if model.entity is null

Normally I work in ASP Classic, and am still a bit green on ASP.Net MVC. I have my model with its fields or entities (might not be the right word hence why not able to find if previously answered, forgive me), and some of these will have null values such as hyperlinks, email address, specific types of phone numbers, etc. What I want to...

Separated Presentation on a UI Centric Application

Hello all, I having trouble figuring out the correct architecture for this kind of application: it's a diagramming application, which resembles MS Visio. The diagrams are used to generated data which is passed to another application. When designing applications, I've always tried to used layering, but now I can't decide how to do this ...

ASP.NET MVC2 : Is it possible to make his own model, withou ado.net

Hello everybody For my project, i need to connect to a database who don't support ADO.net by using NHibernate So, is it possible to make my own model who can be usable by the auto-creation of views of visual studio 2010 ? Best regards. ...

PHP MVC: How to exit from Actions/Controllers early?

In a PHP MVC framework, how can I cleanly and elegantly exit from the current controller/action, but continue normal script execution? For example, let's say my framework normally follows this outline: Map URL to Controller/Action Instantiate Controller, call Action (capturing output) Do stuff Render View At end of Action method, con...

Which is faster to load, PHP or ASP.NET MVC?

Lets say its just for a simple website with pages such as Home, About, Contacts, etc.. ...

CodeIgniter: what makes a good model

What makes a good MVC model in CodeIgniter. What my 'user' model does now is basically using the same active record functions from the database library. The only difference is that you don't need to specify the database table and just do: $this->usermodel->where('username','test'), $user = $this->usermodel->get(); This feels kinda awk...

Database updating incorrect values when passing object from Controller to Repository.

I've got a Controller ActionResult that looks like this Function Edit(ByVal user As Domain.User, ByVal id As Integer) As ActionResult Dim _user As Domain.User = user If ModelState.IsValid Then If Not String.IsNullOrEmpty(user.UserName) AndAlso _ Not String.IsNullOrEmpty(user.WebSite) AndAlso _ No...

How to layout all children of a wxPanel?

I have a wxPython application which allows the users to select items from menus that then change what is visible on the screen. This often requires a recalculation of the layout of panels. I'd like to be able to call the layout of all the children of a panel (and the children of those children) in reverse order. That is, the items wit...

Ordering in dropdown in MVC

Hi I've a problem with a dropdown in a view in MVC. The option-elements in the dropdown comes from a table and should be ordered by a hierarchyId column. I've made a view which orders correctly, but when I create my entity from the view and use it for the dropdown the ordering is ignored. I found out that hierarchyId datatype is not s...

asp.net mvc jquery datatable reinitialization after delete

Can someone tell me how to reinitialize the jquery datatable after delete operation $("#yes").live('click', function () { $("#lgnBx").remove(); var contname = $("#contid").attr("value"); var conturl = $("#conturl").attr("value"); var conthref = $("#conthref").attr("value"); var myurl = conturl + c...

How to deal with null value in <select> HTML filter ?

I have an user interface that print user, and I wan't to have a filter by country. I made a classic <select /> element. In JSP I have <select id="country" onchange="return filter();"> <option value="">...</option> <c:forEach var="country" items="${countries}"> <option value="${country.id}" ${country.name} ...

MVC ReturnURL Form Action and QueryString

Hi All, I redirect the unauthenticated user to login page as /User/Login?returnUrl=blabla to after login redirect the user back to the page where he/she was. I have a form in the login page with action="/User/Login". When the user submits i can not get the QueryString value ReturnUrl. I guess this is happening because i am posting to...

MVC 2 ModelState - Show all Errors

My asp.net form is throwing errors relating to an incorrect model, but on the page it's not showing me what model field threw the error. I'd like to Debug.WriteLine all errors in the ModelState but am unsure how to go about it. Any ideas? ...

Ninject with ASP.Net webforms and MVC

I want to use Ninject in a project which combines ASP.Net webforms and ASP.Net MVC. I'm using Ninject 2, but when I use NinjectHttpApplication from Ninject.Web.Mvc it complains when I use somethings like a PageBase that the Kernel is not created. I have the following in the Global.asax and am unsure what to add. public class MvcApplic...

Supply data available via Jquery in .Net MVC 2

Hi. I am trying to create a partial view I call ImageViewer. It will be called supplying a list of image ids (simplified). I then want to return this partial view, something like imagecontroller.ImageViewer(new int[] { 5, 6, 7 }); yields the following: <div> <img grayuparrow /> <img source="image/getimage5" /> <img blackdownar...

MVC 2.0 Routing Issue - Url parameter not recognized

In my AccountController class I have the following: public ActionResult Verification(string userGuid) { Debug.WriteLine(userGuid); ... In my global.asax I have: routes.MapRoute( "AccountVerification", "{controller}/{action}/{userGuid}", new { controller = "Account", action = "Verification", userGuid = UrlParameter....

C# ASP.NET MVC AJAX Login Form

I am using the MVC Ajax.BeginForm("LogOn", "Account", new AjaxOptions { UpdateTargetId="updateajax" }) <div id=updateajax/> so it only updates to that area. The login form is the ajax.beginform. But can you cancel the AjaxRequest inside the controller. What I wanted is that when I am loggin in the ajax, it will only update the validati...

Sharing presentation logic between C# application with windows and web UIs

I need to build an application in C# that will have multiple UIs, 2 for web and one that will be the same application, but able to be used with no internet access. I am leaning towards MVC for web, then MVVM/WPF for the windows application (Silverlight is not an option). I should be able to inject a different repository implementation ...

How to make the view simpler, the controller more useful?

This question relates to cleaning up the view and giving the controller more of the work. I have many cases in my project where I have nested variables being displayed in my view. For example: # controller @customers = Customer.find_all_by_active(true) render :layout => 'forms' # view <% @customers.each do |c| %> <%= c.name %> <% ...

Visualforce 'Conversion Error setting value' -- binding problem with selectCheckboxes

I am getting a 'Conversion error setting value' when I try to save a record in my controller extension. The page looks the way I would expect, but when I select one or more checkboxes, it gives my that error. I'm not seeing what the error is here. Thanks for the help. The page: <apex:pageBlockSectionItem > <ap...