mvc

MVC Html.ActionLink not passing querystring properly

This seems like it should be pretty straight forward, but I'm apparently confused. I have a List view that displays a paged list. At the bottom I have a set of actionlinks: <%= Html.ActionLink("First Page", "List", new { page = 1} ) %> &nbsp; <%= Html.ActionLink("Prev Page", "List", new { page = Model.PageNumber - 1 }) %> &nbsp; <%=...

How to return a MVC View to a $.Ajax JSON POST

I am sending a $.Ajax POST to a MVC Controller function with parameters and returning a JasonResult successfully. What I need to happen is that the current View be returned (as if it was not a JSON request and I was returning the Viewdata). The Viewdata has been updated and the page needs to be redrawn. In short, I want the MVC Action ...

mvc components in codeigniter?

in yii i could have mvc components (acts like an own application). could i have this too in codeigniter? eg. in SYSTEM/APPLICATION have a folder called COMPONENTS and in there i put stand-alone applications that would be a part of the application. components like ADDRESS BOOK, MAIL, TWITTER and so on. every component folder has folders ...

PHP - Concatenating objects and casting to string - bad idea?

Is it bad practice to concatenate objects when used in this context: $this->template->head .= new View('custom_javascript') This is the way i normally add extra css/js stuff to specific pages. I use an MVC structure where my basic html template has a $head variable which I set in my main Website_controller. I have used this approach f...

How to ajax load a parent-child listbox in JQuery/Asp.net MVC popup?

hi guys, i'm new to the asp.net mvc. and i have a link which will popup show a 3 panes listbox which allows the user to select country, region and language. and when the user click on the language, this will redirect back to the controller and refresh the page and show the proper localized content. i was thinking of using a jquery dia...

When to release the model(representedObject) of the corresponding UIViewController.

Hi, In AppKit we have "representedObject" available through NSViewController, this representedObject is generally set to ModelController or the model which the NSViewController displays, this works great with bindings as you just set the new representedObject and model details are updated in the view, BUT in case of iPhone (UIKit, with ...

Database application using MVC paradigm

In classic Delphi database application we have a form, a set of data-aware visual controls connected to TDataSets via TDataSources. If one wants to design database application using MVC model, where to place TDataSet components? Should they stay on form and therefore be a part of View? Or should they be encapsulated inside some Model obj...

Basic concept: communicating between two views?

How do i send information between two views (and hence, two classes)? Am I looking for my app delegate? Is there a better or alternative way? ...

Why does asp.net mvc form submits itself on button clicks when javascript function error?

hi guys, i'm new to the asp.net mvc, and while working on this, i used very basic asp.net mvc stuff like beginform, etc. i used a lot of jquery codes this round for client side validation, ajax data retrieval, and other gui works. and i used a combinations of html inputs buttons, etc and the asp.net mvc type of controls. what i noticed...

ASP.Net MVC + Live validation - how come the flagged text are all over the place?

hi guys, this is an asp.net mvc project and <% using (Html.BeginForm("ProductAdded", "Home")) { %> <!--form id="frmProductReg" runat="" class="frmProductReg"--> <div id="BreadCrumbPanel" class="breadcrumbCentered"> Register Your Product</div> <div id="MainContentPanel" class="headerCentered"> <!-- Grab the country name via the g...

ASP.NET 3.5 Stateless Session Managment and connection pooling?

I am designing an ASP.NET (3.5) web application that connects to a Rocket Software UniVerse database. I am in the planning stages right now and need some help in being pointed in the right direction. I am brand new to ASP and C#. I am shooting for a RESTful design and a MVC pattern. Rocket provides a .NET library called UniObjects.NET w...

is an instance variable in an action of a controller available for all the controllers view?

I am just trying to print the parameters that have been entered into my form. Basically I create a new bet then I display the parameters: MIGRATION class CreateBets < ActiveRecord::Migration def self.up create_table :bets do |t| t.integer :accepted ,:default => 0 t.integer :user_1_id #proposer t.integer :user_2_id #rec...

ViewData.* and TModel in asp.net MVC

After a week of asp.net mvc2, I still haven’t understood the advantages of ViewData.model or rather how I can properly utilize Viewdata. Can some teach me how to use Viewdata properly? Also what’s TModel that’s associated with viewdata? How does one utilize TModel? The viewdata explanation in spark view engine talks about TModel and I c...

logic before dispatcher + controller?

I believe for a typical MVC web application the router / dispatcher routine is used to decide which controller is loaded based primarily on the area requested in the url by the user. However, in addition to checking the url query string, I also like to use the dispatcher to check whether the user is currently logged in or not to decide ...

Smarty: Display a random sentence from array

I have a smarty template, that I want to display a random sentence on each reload. I could do it with this: in php file: $sentences = array('Hello you', 'Hi mate', 'Welcome'); shuffle($sentences); $smarty->assign('sentence', $sentences[0]); in template file: <h1>{$sentence}</h1> Is it possible to do all this in the template instea...

How to design Models the correct way: Object-oriented or "Package"-oriented?

I know that in OOP you want every object (from a class) to be a "thing", eg. user, validator etc. I know the basics about MVC, how they different parts interact with each other. However, i wonder if the models in MVC should be designed according to the traditional OOP design, that is to say, should every model be a database/table/row (...

How to write the following in MVC?

How can I write the following in MVC? <input type="text" name="ProjectList[' + count++ + '].ID" value = ' + value + ' /> ...

MVC: Model View Controller -- does the View call the Model?

I've been reading about MVC design for a while now and it seems officially the View calls objects and methods in the Model, builds and outputs a view. I think this is mainly wrong. The Controller should act and retrieve/update objects inside the Model, select an appropriate View and pass the information to it so it may display. Only cr...

Circular reference error when outputting LINQ to SQL entities with relationships as JSON in an ASP.NET MCV 2 Web Application

Here's a design-view screenshot of my dbml-file. The relationships are auto-generated by foreign keys on the tables. When I try to serialize a query-result into JSON I get a circular reference error..: public ActionResult Index() { return Json(new DataContext().Ingredients.Select(i => i)); } But if I create my own collection ...

Difference between Url.Action and Html.RenderActionLink and Html.RenderAction

Whats the difference between Url.Action and Html.RenderActionLink in asp.net mvc? ...