mvc

Html.ActionLink showing query url instead of pretty url.

The Html.ActionLink <li> ${Html.ActionLink<HomeController>(c => c.Edit(ViewData.Model.Id, ViewData.Model.Title), "Edit")} </li> When created as html shows the URL to be Edit/5006?title=One . How do I change this to a pretty URL like Edit/5006/One ? My Edit Action method is public ActionResult Edit(int id, string title) ...

CakePHP accessing other controllers

CakePHP Newbie :) I am having trouble accessing another controller and passing that data to a view in one of my controllers: In controllers/landings_controller.php: var $uses = 'User'; function home() { $userdata = $this->User->read(); $this->set(compact('userdata')); } In views/landings/home.ctp: <?php echo $this->us...

ASP.NET MVC Html.textbox - How to validate numbers only?

With the HTML helper, how would you enforce number only without submitting? I know it was done with regular expression if you had a textbox in classic ASP.NET <%=Html.TextBox("txtYearOfWork",String.Empty, new { maxlength = 4, size="5", autocomplete = "off" }) %> ...

Why is the HttpContext.Cache count always zero?

I set up a few pages with OutputCache profiles and confirmed that they are being cached by using multiple browsers and requests to retrieve the page with a timestamp which matched across all requests. When I try to enumerate the HttpContect.Cache it is always empty. Any ideas what is going on here or where I should be going for this ...

How can I setup a simple custom route using Zend Framework?

I'm looking to setup a custom route which supplies implicit parameter names to a Zend_Application. Essentially, I have an incoming URL which looks like this: /StandardSystems/Dell/LatitudeE6500 I'd like that to be mapped to the StandardsystemsController, and I'd like that controller to be passed parameters "make" => "Dell" and "model"...

How to embed multiple jQuery line of code in custom HtmlHelpers ASP.NET MVC

I 've tried to create my own HTML Helper which work fine for my need but I can't embed many lines of jQuery code in my extension HtmlHelpers class. I've tried @ literal for jQuery code I doesn't work or I need to escape every line of code that I thing I not good for multiple line of code. I don't know if there is another way to achieve t...

when should i use multiple controllers in mvc?

are there times you might want to use multiple controllers in mvc? eg. /controllers/foo.php /controllers/bar.php or /controllers/foo/baz1.php /controllers/foo/baz2.php /controllers/bar/baz1.php /controllers/bar/baz2.php could someone give some examples WHEN i might want to do that and some example controller names. one occasion...

MVC (model-view-controller) - can it be explained in simple terms?

I need to explain to a not-very-technical manager the MVC (model-view-controller) concept and ran into trouble. The problem is that the explanation needs to be on a "your grandma will get it" level - e.g. even the fairly straightforward explanation offered on MVC Wiki page didn't work, at least with my commentary. Does anyone have a re...

How to handle form submission ASP.NET MVC Back button?

Hi guys, i have a form which allows the user to key in the data and then submit. if everything works well on this action result, then i will redirect the user back to a thank you page. my problem right now is that when the user click on the back button, they will be able to go back to the form page and the inputs will still be there. a...

Returning a JSON view in combination with a boolean

What i would like to accomplish is that a partiel view contains a form. This form is posted using JQuery $.post. After a successfull post javascript picks up the result and uses JQuery's html() method to fill a container with the result. However now I don't want to return the Partial View, but a JSON object containing that partial view...

Serialize model into Query string

Hi. Would it be possible to serialize a model object into a query string? I've no idea if this is even possible, but if not, what is the best way to do this? <% Html.RenderAction("Grid", "Grid", new { gridModel= ViewData["model"]}); %> The Model is containing ca 20 properties, and creating the querystring with them in individually wo...

TinyMCE client validation problem

Hi, I have problem with TinyMCE editor. I have form with few text fields and textarea (tinymce), and enabled client validation. When I click save button validation occures on all text fields, but it takes 2 click to validate tinymce content. Furthermore, validation shows message only when field is empty, or if condition is not satisfied ...

Explain the pros and cons of using the spring framework

Saw this question in career cup website. can someone Explian the pros and cons of using the spring framework ...

CodeIgniter - accessing $config variable in view

Pretty often I need to access config variables in views. I know I can pass them from controller to load->view(). But it seems excessive to do it explicitly. Is there some way or trick to access $config variable from CI views without disturbing controllers with spare code? ...

ASP.NET MVC Validation - localisation of the error string

I followed the techique ASP.NET MVC 2: Model Validation from Scott Gu. (http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx). However I am building a localised web site. How can I localized the error string? I tried the following by replacing the following: [RegularExpression(@"\d{4}",ErrorMessage="M...

Grouping controllers and views in Rails MVC

Hi, I want to do something similar to the question here: http://stackoverflow.com/questions/848034/grouping-views-controllers-models-in-mvc But in Ruby on Rails. And the catch is, Models are to be grouped in a folder, but Controllers and Views are to be put in different folders, say admin/ and store/ folders. Tried to separate these i...

JavaBeans JSP dealing with GET requests

Hello, I understand how POST works but if for example the following GET request is made: GET /index.jsp?page=home How do I get the value, in this case home through to my java bean. i.e. using an MVC architecture? Thanks ...

How do I alter the URL?

I'm currently working on a big web application for a company and we are about 4 months in, but we have a harmless(but annoying) problem that we have just left because we didn't time to change it. The way we setup our MVC is leaving us with the Servlet being stacked one after the other endless amounts of times on the URL so if we had a S...

Rewrite URL in IIS7 .NET MVC

Hi, I'm trying to rewrite the url: https://mydomain/phone-append to https://mydomain/Service/PhoneAppend using the following rule: <rewrite> <rules> <rule name="Phone Append"> <match url="phone-append" /> <action type="Rewrite" url="/Services/Index" appendQueryString="true" /> ...

get data from mysql database

How get data from mysql database? I use ASP.NET and C#.Previously, I used LINQ but it does not work with mysql database ...