I was reading: http://stackoverflow.com/questions/2794831
But I have give a compilation error:
CS0246: The type or namespace name 'DataTable' could not be found (are you missing a using directive or an assembly reference?)
How do I fix this?
...
I'm working on my first real ASP.NET MVC project and I've noticed that the controller I've been working in is getting rather large. This seemingly goes against the best practice of keeping your controllers thin.
I've done a good job keeping the business logic out of the controllers. I use a separate layer for that. Each action primar...
I have a simple integer property in a display model. We'll call it "MaxDays". I'm building an MVC app, and I've got the standard set of display and validation statements which will make use of the DataAnnotation attributes attached to the model:
<%: Html.LabelFor(x => x.MaxDays) %>
<%: Html.TextboxFor(x => x.MaxDays) %>
<%: Html.Valida...
I have HandleError attribute working normally, however:
I have a jqueryui dialog that displays a partial view. If i generate an error in this action the dialog just remains blank and no redirect to the Error.aspx page.
What do I need to do to get this to work?
...
This design question needs a bit of context, so please bear with me.
I currently have three models that go something like this:
class MyItem < ActiveRecordBase
has_many :my_list_items
...
class MyList < ActiveRecordBase
has_many :my_list_items
has_many :my_items, :through => :my_list_items
...
class MyListItem < ...
Hi,
I'm trying to use the jquery ajax function to post to a MVC2 controller action, but my parameters include an array of a (simple) custom class and the action is not getting the data correctly.
Client:
var element1 = { FirstName: 'Raymond', LastName: 'Burr' };
var element2 = { FirstName: 'Johnny', LastName: 'Five' };
var var2 = [el...
Hi,
I’m about to write quite a big web site that will basically be a forum, divided to (many) different subjects and allow users’ score.
I’ll be using MVC, so I (“naively”) asked this question about how to partition the Model portion of MVC, which is likely to be very large.
Two things I realized from the answers I got:
I really do...
This is a question I had about working with the Kohana framework, though I imagine that this is something that could apply to MVC frameworks in general.
Let's say I have 2 objects/models, an animal object and a farm object, where an animal belongs to a farm, and a farm has many animals. I have a form for creating new animals, and I want...
I have such an array for rendering TableGear:
array(
"database" => array(
'username' => $this->config->resources->db->params->username,
'password' => $this->config->resources->db->params->password,
'name' => $this->config->resources->db->params->dbname,
'table' ...
I have created a sign-up and login for my website and all validation works fine for both sign-up and login. After user provides valid credentials he/she is logged into the member area with a welcome message that says Hello first_name last_name.. basically first name and last name is grabbed from database.
Any what I want to do is restri...
A name field needs to be verified as starting with a capital letter and not being allowed to take a number. I'll do this with regular expressions. Implementing the MVC pattern.
Should I have the controller send the value that was input to a checking class and send corresponding error msg's back to the UI and after checking then call t...
I asked here a while ago for some help in understanding MVC, since I'm very new to the topic. I thought I had a decent understanding of it, and this is documented in a blog post I wrote recently on the subject. My understanding basically boils down to this:
Controller: Determines what needs to be done to fulfill a request, and utilizes ...
Hi,
I was thinking about extending all my controllers from the indexController. I have in the index controller a init() function that does alot of stuff. This is not executed upon fooController request.
I allready have a registered a viewSetup plugin. And this is executed on all requests and thats just fine.
My problem is a have blog ...
Hi,
This is more a "Am i doing it right?" question.
I am using a MVC framework ( Zend Framework ) and was wondering if this is the best way to structure a model.
In this case i have an user groups model and, after coding for sometime, i realized that on my controllers i was repeating some stuff like a query to return visible groups.
...
Using PHP, If I have a model (a class) where I various queries, whatever I need, and in my controller, I use myModel = new CustomerModel(); and later in the controller, say I call myMyodel in the controller (I know looks like codeigniter but I am not using a framework) to:
$data['query'] = myModel.OrderByLastName();
how do I pass that ...
I am using the great Tequila-JSON Parser ( http://github.com/inem/tequila ) in an Web-application, to render more or less complex JSON server-replies. More and more the JSON-Templates (.jazz) are growing in somehow real "views". I am trying now, to get an instance-variable from the according controller, into the .jazz template, but this ...
So i have a mvc system setup but it does not generate search engine friendly urls.
A typical url is in the format:
http://sitedomain.com/class/classMethod?parameter=valueA?parameter2=valueB
This is what i need to have:
http://sitedomain.com/class/valueA/valueB/
My .htaccess actually modified a part of the url already but i dont kn...
I'm new to MVC and Zend Framework and I'm working on a project, mostly on the front end. I'm trying to get a sense of what are best practices.
Currently the footer and header are setup through several scripts, one that is a giant XML file of all the content on the website (I think to make the website international friendly, things are w...
Hi All,
I've been stuck on this for the last few hours. I got it working by hacking a few lines in /lib/Varien/Data/Collection/Db.php, but I'd rather use the proper solution and leave my core untouched.
All I need to do is get a collection and filter it by two or more fields. Say, customer_firstname and remote_ip. Here's my (disfunctio...
In MVC, is it possible to pass an array of string (List<string>) from C# code to viewdata and then retrieve the value in the view? e.g:
C#:
List<string> names = new List<string>();
names.Add("a");
names.Add("b");
ViewData["names"] = names;
MVC view:
<script type="text/javascript">
var nameList = '<%= ViewData["names"] %>';
</script>...