mvc

cakephp: get values from a "cat" table in the "users_controller.php" file?

Hi i have table "User" and a Controller "users_controller.php" and i have another table called "cateogry", need to retrieve values from this table in the "listall" action(site.com/users/listall). how can i get values from another table. ...

Xval and Tinymce

I have a problem on submitting an asp.net mvc form that is using Xval for validation and uses TinyMce as an editor on two text areas. The TinyMce editor is initialized with the new tinymce jquery plugin and the form validation and submission works perfectly if I remove the editor. But if I initialize the editor the form is submitte...

Who has the responsibilty of loading data?

In the MVC model, where does the responsibility of loading the view model lie? Should the Controller load the data? Should the View Model itself load the data ala: MyViewModel viewModel = MyViewModel.Create(someValue); Should a Service Layer load it ala: MyViewModel viewModel = MembershipService.Instance.Load(someValue); ...

How to get ContentType for file in ASP.NET MVC when using File Action Method

Hi there, Attempting to use asp.net mvc's Action Result of File. So it would seem that I have to specify a ContentType for the file to be sent to the browser. Currently there is no real limit to what types of files may be sent to the browser in my application, so I can't always assume it will be a "text/pdf", for example. What's the b...

How to access .net MVC ViewData from Jquery directly

I am passing viewdata into my aspx page like so: //Controller List<user> userList = Data.GetAllUsersForCompany(companyId); List<SelectListItem> dropDownList = FormatUserList(userList); ViewData["UserList"] = userList; ViewData["FormattedUserList"] = dropDownList; return View(); I am populating a drop down with the name of a user, whic...

Paging in MVC + Jquery

Dear all, I need to add paging for my users view page, i got all the datas using Json to show in the table..i need to add paging and and also i can able to change number of users to show in a particular page. any simple Jquery plugin or source code will be very much helpful to me. thanks in advance, K ...

Saving contents of ApplicationState in ASP.Net (MVC)

I have an internal app used to edit XML files on disk. The XML files are loaded into an object model which is stored in ApplicationState. I need to save this data. The one option is to do this every time the user changes some data. However, this seems a bit inefficient - writing the data out to disk each time a change is made. Instead,...

__call() function in CakePHP?

hi, is __call() function availabe in CakePHP? I used this fucntion in Zend Framework. class UsersController extends AppController { function home(){ /*some action*/ } function __call($m, $p){ print_r($m); print_r($p); } } getting erro like this Missing Method in UsersController <?php class UsersController extends AppController { ...

How to log WCF exception shielding's {Guid} in client

I'm using WCF Exception Shielding to map various exceptions to FaultContracts so I can limit what information I expose to the client. I had hoped to leverage the {Guid} mapping property so I could correlate client logs and server logs: <mappings> <add source="{Guid}" name="Id" /> <add source="{Message}" name="MessageText" /> </mapp...

CakePHP Session vaiable use in view page?

hi i have a varible contaning "username" and want to get these values via session to any of the view page. How can i use session vaible in view ...

how to? mod_rewrite in different .htaccess files per folder move into vhost.conf - mvc

Hi there, I hope I will find a help here. I have a quite complex MVC driven application. Here how it works: these are my directories / - (/dispatcher.php as mvc1 app bootstrap) /mvc2 - (/mvc2/dispatcher.php as mvc2 app bootstrap) /mvc3 - (/mvc3/dispatcher.php as mvc3 app bootstrap) all 3 are accesible under one domain example.com...

Allowing http verbs for one user in Views folder (MVC, Expression Web 3, webdav)

I'm using Expression Web 3 to sync my local MVC project with my remote server, but the Publishing option in Expression can't query the Views folder because of the blockviewhandler. Is there a way to allow a single user (like Administrator) to not be blocked and still block everyone else? ...

link_to() in Rails flash

When a user fails login on my Rails app, I'd like to point them to a password reset page: flash[:notice] = "Login failed. If you have forgotten your password, you can #{link_to('reset it', reset_path)}" However, I can't use link_to in a controller. What's the best way to do this without mixing controller and view logic? My best gue...

Ajax.ActionLink lost my JavaScript !

Here's my situation. I have a div on my home page that I use to do a Html.RenderPartial(PartialView). Initially PartialView1 is rendered in this div properly and I can access javascript in the PartialView1.ascx file. So far so good. I also have an Ajax.ActionLink that has the InsertionMode=InsertionMode.Replace. When the Ajax.ActionLi...

What's the best way to learn mvc in PHP?

I'm totally new to mvc,how to pick it up? ...

Return multiple views to one ActionResult with ASP.NET MVC

What I want to achieve essentially is: Items assigned to me Item 1 assigned to me Item 2 assigned to me Item 3 assigned to me All open items Item 1 open to everyone Item 2 open to everyone Item 3 open to everyone Item 4 open to everyone Though from what I have experienced of MVC so far is that I would have to return the data to the...

How do MVC components fit together?

I've seen a number of examples of ways MVC components fit together on the web. The Controller retrives data from the Model and passes it to the View This seems a bit verbose and messy. $model = new Model; $view = new View; $view->set('foo', $model->getFoo()); $view->display(); The Controller passes the Model to the View What if t...

Accessing methods from another CakePHP controller, or better alternative!

I am creating an 'award' system for my website to encourage a community fealing, much in the same way that stack overflow uses badges. The site is built in CakePHP, i have created an Award model, controller etc - currently the methods for calculating whether a user has an award are contained within the Award controller. However, i can'...

How to test duplicate email addresses in .NET MVC

I have added functionality to the Accounts Controller -> Registration ActionValidateRegistation function to test for blanks in the user registration form. I now want to throw an error to the form if the email address the user entered is already in the system. I have added the function checking for the duplicate email address at the en...

Get Birthday reminder Linq Query ignoring year.

Hi all Am using C# MVC and i need to get the user details who having birthday with in next 20 days. using linq to sql query which wants to compare only date and month and not the year, to fetch the users who having birthday within next 20days, anyone kindly help me with the linq to sql query to get the users who having birthday within n...