mvc

Error handling in the model, or in the controller?

Hi! I asked around on various IRC channels but was unable to get an answer with a definitive explanation behind it. Should errors (pertaining to the model, such as transaction failures) be handled in the model, or in the controller? Thanks in advance for any help. EDIT Well, the confusing thing is that my code (in the model) looks so...

asp.net mvc ajax.beginform ckeditor integration

how will i integrate ckeditor in ajax.begin form . it is not working . how will i make it work <% using (Ajax.BeginForm("OrganizationPhysicalPath", new AjaxOptions { OnSuccess = "Begin6" })) {%> <div id="Headers" style="display:none"> <div id="Header"> <ul> <li><a href="#Header-1">English</a></li> <li><a ...

asp.net mvc ckeditor in jquery dialog

can ckeditor be loaded in jquery dialog , if yes then how ...

log4Net, MVC, and dependency injection

I have an application with a few classic layers DAL, BLL, PL, and Unit Of Work. The goal is to log BL layer with MVC User info. In MVC presenter layer I made my own realization of DefaultControllerFactory for creating Service Locator. Here I register IBusinessLayer on BusinessLayerConcrete, and Controllers on themselves for their next...

Using models in CodeIgniter...

Can somebody explain to me when it's a good practice to use models in CI? An article in wikipedia was referring to CI models as "entirely optional and are rarely needed" is that true in any way?thanks in advance! ...

ASP.NET Routing - Ignore routes for files with specific extension, regardless of directory.

Say I want to remove any mapped routes for files with a certain file extension. RouteTable.Routes.Ignore("{root}.hello"); Works for any file that has the extension .hello in the root directory, however as soon as i go into any subfolders the 'ignore' rule isn't applied. Ive tried lots of different combinations, but can't seem to get...

ASP.NET MVC - TextArea values

Hi Everyone, I have a WYSIWYG editor set up using ASP.NET MVC. When I post, everything is fine, however when I post and there is an error when the page comes back and shows the errors, the value in the textbox is messed up (it has become un-HTML Encoded) and for form validation reasons, this is fine. My question is this - how, in the co...

escaping a " in NVelocity

how can I escape " in NVelocity ? e.g. test.message = "136# 1/4" Test Test Test" if I do <input type="text" id="Test.Description" value="$test.message"/> it displays : 136# 1/4 if I do <input type="text" id="Test.Description" value=$test.message/> it displays : 136 if I do <input type="text" id="Test.Description" value='$test.messa...

GET and POST to same Controller Action in ASP.NET MVC

I'd like to have a single action respond to both Gets as well as Posts. I tried the following [HttpGet] [HttpPost] public ActionResult SignIn() That didn't seem to work. Any suggestions ? ...

Events on DOM elements not yet created, in Javascript?

I have a Javascript module the following Javascript: EntryController = function$entry(args) { MainView(); $('#target').click(function() { alert('Handler called!'); }); } MainView() has a callback that creates the #target button. Because of the callback the code will pick up and run through the rest of the code $('...

Render View programmatically into a string

I would like to get the html code a view would generate in a string, modify it in my controller, then add it to my JsonResult. I found code that would do what i'm talking about from a partial. I would like to do it from an aspx View though. -- Extra explanation: Let's say I have a page Frame.aspx that /Controller/Frame will return I ...

how can i assign value to a Html.Hiddenfor from a jquery/ javascript

I have a hidden asp.net MVC control in the form: <%= Html.HiddenFor(m => m.NodeId) %> my JavaScript / jQuery code: var DeleteEntireItem = '<% = btnDeleteEntireMenu.ClientID%>'; var Node; debugger; $('#' + DeleteEntireItem).click(function () { Node = NodeValue; document.forms[0].submit(); }); How can I assign the value of v...

Null ControllerContext in my custom Base Controller

Hi. Could you tell me MVC 2 Life cycle The problem: I got my own BaseController class where i try to get ControllerContext in constructor. It's "null" Question: where does ControllerContext fill? ...

MVC where to format numbers?

shell i format my numbers 1234.20 => 1'234.20 in model or in view using php and codeigniter? ...

Implementing MVC/MVP Design for TabControl ..design question

Hi All, I have a an Winform application with 2 forms. In one form I have a Tab Control with 3 Tabs and navigation buttons to switch between tabs. On the first tab the user selects a file and on navigating to next tab i want to do some processing on the file selected in the first tab,and show the result in the 3rd tab. The other form j...

"MVC" and controlling a jMenubar depending on selected jTabbedpane from a "Control" class

Right so I know my code/structure is pretty messy, I've not done MVC before and I'm pretty sure I've done it wrong anyway. I want to be able to "control" the jMenubar depending on which tab is selected. I have a main GUI class which simply creates a new "MenuBar" and each new "PanelXXXX", where "PanelXXXX" could be "PanelDesign", "Panel...

Very weird behavior with Linq to SQL and MVC

I have an Action that requires authentication. The action method creates some records with foreign keys using Linq to SQL. When the user calls the action and is logged in the method works without a problem. When the user is not logged in, MVC redirects them to the login page with the returnUrl parameter. After a successful login the acti...

Can ASP.NET state management be daunting for beginners?

To all you ASP.NET experts and beginners, do you look at a state management as a difficult and annoying task to do? If you were to start over with ASP.NET would you consider ASP.NET MVC and never have to deal with ViewState again? Also , is it true that once you go ASP.NET MVC you never go back to ASP.NET Webforms (Unless of course your...

Is it possible to send mail using OAuth for GMail

I want to send mail from user gmail account using OAuth to all user contacts. It's easy to get all contacts of user with google API, but i cant send email to these contacts from user gmail account without request his password. ...

is there a good PHP CRUD code generator?

Is there any better PHP CRUD code generator? I want to get Data Access Object, Business Object and Value Object. It would be difficult to match my needs, but I am happy at least I can get any relevant one. Thanks in advance. [EDIT] I am working on an MVC based application. I am using my own MVC framework. I need this code generator to ...