Home
Get Started
Learn
Downloads
AJAX
MVC
Community
Wiki
Forums
Sign in
|
Join
Home
›
ASP.NET Forums
›
Search
Search
You searched for the word(s): userid:665172
More Search Options
RSS Available
Matching Posts
Re: Iterating Through IQueryable Inside Another Object
I did not get an error using your suggestion. I just wasn't able to access the properties of an assessment via intellisence, which to me means that I'm not referencing things correctly. Ok so I'm going to post more code here. This is what is in my controller: public class CourseAssessmentsFormViewModel { // Properties public Course Course { get; private set; } public IQueryable<Assessment> Assessments { get; private set; } // Constructor public CourseAssessmentsFormViewModel(Course
Posted to
ASP.NET MVC
(Forum)
by
przemeklach
on 11/11/2009
Re: Iterating Through IQueryable Inside Another Object
Ok I found my problem. Your answer helped. My inherits was wrong: My new viewmodel is in the controller package and not the model. System.Web.Mvc.ViewPage<dfordiploma.Controllers.CourseAssessmentsFormViewModel> Now everything works. Thank you.
Posted to
ASP.NET MVC
(Forum)
by
przemeklach
on 11/11/2009
Iterating Through IQueryable Inside Another Object
I have an action that finds a Course object and then finds a IQueryable list of Assessment objects for the course. IE a single Course will have multiple Assessments. Once I find the list of assessments I attach them to the course via the 'assessments' property (assessments is of type IQueryable). My question is how do I itereate through that list of Assessments in the view? public ActionResult CourseAssessments(int courseID) { Course course = courseRepository.GetCourse(courseID); course.assessments
Posted to
ASP.NET MVC
(Forum)
by
przemeklach
on 11/9/2009
Re: Iterating Through IQueryable Inside Another Object
Neither of those suggestions worked. I'm not able to get intellisense for any of the properties insided my assessments. I went back to using a new view model class instead. I think doing it this way is better software design since it limits coupling. So my code looks like the following. public class CourseAssessmentsFormViewModel { // Properties public Course Course { get; private set; } public IQueryable<Assessment> Assessments { get; private set; } // Constructor public CourseAssessmentsFormViewModel
Posted to
ASP.NET MVC
(Forum)
by
przemeklach
on 11/9/2009
Re: Business Logic Best Practice
I know that there is not perfect solution or any golden rule when it comes to software. My undergrad in engineering has thought me that; however, I know that there are certain standards that people tend to follow when using different frameworks, be it ASP MVC, Java Struts or what have you. I just wanted to get a feeling from the ASP community on the subject. Thanks for your input.
Posted to
Architecture
(Forum)
by
przemeklach
on 9/24/2009
Re: Business Logic Best Practice
Thanks for your reply. What is SP? Your suggestions make sense. But what I'm trying to determine is what is the most appropriate place, form design point of view, to put all this logic. Should I be catching this exception in the model somewhere or right in the controller? BTW, I'm using ASP MVC for my application. Thanks.
Posted to
Architecture
(Forum)
by
przemeklach
on 9/22/2009
Re: Business Logic Best Practice
I'm using Linq to Sql for database access. All my query logic is currently done using linq and not stored procedures. Is this a recommended practice or should I be writing my queries as SP's? I.E. would it be easier to manage these business rules using SP's?
Posted to
Architecture
(Forum)
by
przemeklach
on 9/22/2009
Re: DropDownList set selected value.
Thanks for your reply. I didn't exaclty copy your code but it definately lead me in the right direction to fix mine. Thank you. I've attached the relevant parts of the View and Controller for completeness. <p> <label for="School"> School:</label> <%= Html.DropDownList("School",ViewData["Schools"] as SelectList, Model.Course.SchoolID)%> <%= Html.ValidationMessage("School", "*") %> </p> // // GET: /Courses
Posted to
ASP.NET MVC
(Forum)
by
przemeklach
on 9/21/2009
Business Logic Best Practice
I need to implement some business logic for my application. In my create and delete actions I need to add logic to ensure that new entries in my db are unique and that if I'm deleting and entry in my db that no other entries depend on that entry. E.G. I have a school and course entity in my db. One of my business rules is that school entries have to be unique (ie the combination of name and address can only appear once). Another rule is that a school cannot be deleted if it has courses. And so
Posted to
Architecture
(Forum)
by
przemeklach
on 9/21/2009
DropDownList set selected value.
So I have a school and course table in my database. The course table holds the schoolID for whichever school it belongs to. In my view for creating/editing courses there is a drop down list that contains all the schools in the database. The problem I'm having is with my edit action. When I get the view for the edit action for a Get the list does not contain the correctly selected school. When I change the school it does not get saved to the database. Here is the exert from my view for the dropdownlist
Posted to
ASP.NET MVC
(Forum)
by
przemeklach
on 9/19/2009
Page 1 of 12 (117 items) 1
2
3
4
5
Next >
...
Last »
Channel 9:
E2E: Brian Beckman and Erik Meijer - Co/Contravariance in Physics and Programming, 1 of 2
TechNet Edge:
Windows Server 2008 R2 Quick Look #3 - PowerShell V2
ASP.NET:
2009 Blogged - Greatest Hits
WindowsClient:
2009 Blogged - Greatest Hits
Channel 9:
Nikolaj Bjørner and Leonardo de Moura: The Z3 Constraint Solver
Channel 9:
MEF & Silverlight 4 Beta - Part 2, Imports & Exports
Channel 9:
MEF & Silverlight 4 Beta - Part 1, Introduction
WindowsClient:
The (Near) Final Word on Multi-Monitor Taskbars for Windows 7 - Ultramon vs. DisplayFusion
WindowsClient:
Looking back at 2009, and forward to 2010
Silverlight:
Polling Video – A Viable sub-second alternative?
TechNet Edge:
Windows Server 2008 R2 Quick Look #2 - Active Directory Recycle Bin
Channel 10:
I'm a Windows 7 PC Themes
Channel 10:
24 Years of Windows Box Art
WindowsClient:
Silverlight tutorial: HOW TO build CommandLink Control in Silverlight with Expression Blend 3 and Behaviors
ASP.NET:
Converting an RGB Color To Hex With JavaScript
Silverlight:
Silverlight HVP Design – Configuration & Scenarios
Channel 9:
Channel 9 Live at PDC09: Day 3 Welcome
Channel 9:
Channel 9 Live at PDC09: TWoC9 Day 3
Channel 10:
Microsoft's Mobicast: Stiched Cell Streams
Channel 10:
Festive Bing
Microsoft Communities
ASP.NET
Channel 8
Channel 9
Channel 10
IIS.NET
Silverlight
TechNet Edge
WindowsClient
Mix Online