I have an update method in my users controller that I call from a HTTPService in Flex 4. The update method is as follows:
def updateName
@user = User.find_by_email(params[:email])
@user.name = params[:nameNew]
render :nothing => true
end
This is console output:
Processing UsersController#updateName
(for 127.0.0.1...
I have a model that is stateful. In each state there are a selection of actions that the user might want to perform on an instance of the model. Currently I am translating the model state to actions that get represented in the view using a view helper.
Something like this... in the model:
Class Thing
def state_is_A?
state == 'A'...
Hi
I have a template partial view, which used to render a model named VerificationCode, this model has a element 'CaptchaGeneratedText' which is hidden in the view and set value by Html.HiddenFor(m=>m.CaptchaGeneratedText, captchaText), the problem is when view post, in the model validation the value of element 'CaptchaGeneratedText...
I developed an asp.net mvc application. In one of my forms, I'm getting a following
exception:
A public action method 'UpdateBasket' could not be found on controller 'App.Controllers.WebShopController'
But the funny thing is, that form submit works (even in debug mode) and finds an
ActionMethod UpdateBasket and returns View.
The prob...
which one is best ORM for using in CMS based application
...
Hello All:
I am creating one application in .net MVC, in which I am using jQuery AJAX to post some data to server. The data posting is working fine, but I also need to upload one image along with the data. I have searched on stack over flow for similar question but they are not able to help me. I donot want to use flash to upload file, ...
I have a button on my page and when the user clicks that,they should be able to print the document. the user sees the image format of the pdf file in the gallery view. How should I handle the print for this document?
...
So i have the following checkbox (tho my question relates to any type of field )
Within the same form i have
<%= Html.EditorFor(userProfile => Model.UserProfile)%>
and this validation is working fine from the following js files
<script src="/Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="/Scripts/Micro...
How to handle Application_BeginRequest using a custom filter in asp.net mvc?
I want to restore session only for one route (~/my-url).
It would be cool, if I could create a custom filter and handle that.
protected void Application_BeginRequest(object sender, EventArgs e)
{
var context = HttpContext.Current;
if (str...
Hi everyone,
I haven't delved into custom generation of friendly URLs in ASP.Net MVC, and was wondering if anyone had suggestions. For example, if John Smith were to create an account on www.example.com, I'd like for his homepage to read www.example.com/JohnSmith -- along with the option for him to choose his URL. The ideal is for thi...
I am struggling with DataAnnotations in MVC. I would like to validate a specific property, not the entire class but need to pass in another property value to validate against. I can't figure out how to pass the other property's value, ScheduleFlag, to the SignUpType Validation Attribute.
public class Event
{
public bool Sc...
Does MVC have an equivalent to the web forms icallbackeventhandler. Webforms allow you to make a call a function after the page has loaded.
Any guidance is appreciated.
...
I have used jquery jstree or dynatree using check boxes and found the same logic
The thing is that the if for example there is a parent and 4 child.
a) i select all the 4 child (parent get auto selected) the 4 child and the parent node id get posted to the controller.
b) But if i select less then 4 children (parent get auto selected) ...
Hello,
I have a Java application and I want to implement an Undo/Redo option. the value that I want to stock and that I want to be able to recover is an integer.
My Class Model implements the interface StateEditable and I have to redefine the 2 functions restoreState(Hashtable<?, ?> state) and storeState(Hashtable<Object, Object> state...
I have an DQL query in LocationTable.class.php
For this query i need an id which is passed to the action via the URL ?id=2
In the action i can access this with $request->getParamater('id'), but how can i also make this available to the model where my query resides? i need it for a where clause.
...
Can i initialize var with null or some empty variable.
...
Ive managed to get asp.net mvc up and running on an iis6 server, but I keep getting silly messages like 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial'
I've got all the required dlls and even installed mvc from
http://www.microsoft.com/downloads/details.aspx?FamilyID=c9ba1fe1-3ba8-439a-9e21-def90a8615a9&...
Hi,
I need some data to be available on all the viewpages inside the website. The data comes from an parameter supplied to all the routes, i want to get that param and get the according data for it and make it available for all the views (including the master pages).
It would be nice if it could be done in one place.
What do i need to...
A colleague of mine ran a simple load test using VS2010 on a Webforms project and an Asp.net MVC project and noticed that Webforms was serving around 83 requests per second whereas Asp.net MVC was serving 28 requests per second. Both the sites were published on the same server with similar settings.
Webforms project had 10 pages 5 of th...
I've got a class Widgets. Widgets are made up of Doohickies. I'm never going to need to access Doohickies directly via url -- they're essentially a private class, only used by Widgets. Where do you put your code to define the Doohicky class? In /app/controllers/doohicky.php? in app/controllers/widget.php? somewhere else? Obviously, the f...