15,892,746 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by AlexHarmes (Top 17 by date)
AlexHarmes
28-Jan-14 6:06am
View
No, that part I get - my question is how do I know if it was form1, form2 or form3 that was submitted? I cannot find any distinguishing returns to identify which form the input is coming from.
AlexHarmes
25-Jan-14 11:53am
View
Do you have an example of how I could isolate get it from the FormsCollection as I am not at all familiar with its proper use?
AlexHarmes
20-Jan-14 13:13pm
View
I have sent you the files by email as well as a new screen shot. You will see it is one array I am really struggling with!
AlexHarmes
20-Jan-14 12:27pm
View
No aspx just view - cshtml. Do you do views?
AlexHarmes
20-Jan-14 12:10pm
View
The get action should return a screen exactly like the screen shot I sent you, just with the two options the user selected will appear selected. I have not gotten that far as I have not gotten a version with 2 Questions on the same page to populate with all the options for each question listed.
It could also be a dropdownlist or radio group - OR it could be a text box then there would be nothing in the QuestionOption table at all but the response would be saved in the Response table.
AlexHarmes
20-Jan-14 11:57am
View
Id,
Question1,
QuestionOption1(array of all options in QuestionOptions with QuestionId matching Id,
Answer from Response table IF logged user has answered the question.
AlexHarmes
20-Jan-14 11:52am
View
Uh, how do I do that please?
AlexHarmes
20-Jan-14 11:33am
View
Did you get it?
AlexHarmes
20-Jan-14 11:17am
View
I am still struggling. I tried to copy the code you left but it wouldn't build. I have adapted mine further but still fail to get the QuestionOptions array. And I don't know how to post a screen shot here for you. But basically I am NOT building a grid, but a question and answer page. A question can be a simple text box with NO value or row in the QuestionOptions table, or a dropdownlist, a group of radio buttons or checkboxes and each will have its own row. So it should present one question, all the options, if any or a textbox.
The code I posted above works to fill all fields EXCEPT the options array.
AlexHarmes
20-Jan-14 10:03am
View
By any chance are you around now? I have been up half the night but I still cannot get the results I need;
AlexHarmes
18-Jan-14 16:09pm
View
At first I was using this action;
public ActionResult ViewQuestion(int? id)
{
if (id == null || id == 0 || id > 13)
{
id = 8;
}
Question question = db.Questions.Find(id);
if (question == null)
{
return HttpNotFound();
}
return View(question);
}
It worked fine with the EDMX class Questions, but it was creating screens based on the Id field of Question and one question per screen. What I need is to sort on PageNumber as there can be more than one question on a page and UserId so I can get any answers already submitted by the logged in user. Should I add a screen shot to show you what I mean?
AlexHarmes
18-Jan-14 15:37pm
View
How can I write the query so it only returns one question and many options? I tried Groupby but that didn't work at all. Am I missing some syntax to do this correctly?
AlexHarmes
18-Jan-14 14:27pm
View
Hmmm, this is still not working for me as it is only returning one value for QuestionOption. I seemed to have left it out of my select statement too, it should be QuestionOption1 = qo.QuestionOption1. It does not return a collection or list at all for me.
Also I want to make sure it only returns a single row for question then the list of options. I hope this makes sense to you as I really appreciate the help.
In my view it is breaking on this line;
@foreach (var item in q.QuestionOptions.OrderBy(o => o.QuestionOptionRanking))
AlexHarmes
18-Jan-14 14:05pm
View
what is the query returning - and how can you try it without the DB behind?
AlexHarmes
18-Jan-14 13:42pm
View
When my View Returns, there are no values for join qo in db.QuestionOptions on q.Id equals qo.QuestionId but I know there is data in there. As I said it is a one to many relationship and it should be returning a list of QuestionOptions for reach question.
AlexHarmes
10-May-12 12:21pm
View
Many thanks - I've been working on this for days!
AlexHarmes
10-May-12 11:39am
View
Yes, thanks. This is the article to disable, however I need to know how to ENABLE if I have added the <sessionstate> to OFF in the web.config. Ideas?
Show More