15,897,273 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 jagan12013 (Top 9 by date)
jagan12013
3-Aug-16 7:52am
View
Now i'm going to dry like this and one more thing the issue on row edit Multi check box select list item form the back end and assigning the row_editing problem
jagan12013
3-Aug-16 6:38am
View
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control
jagan12013
2-Dec-15 6:42am
View
suppose i have some question and answers. in view displaying the 5 questions at once after that i have a next button again i need to show the next 5 questions like wise. so which approch can i follow. I think not a pagination.
jagan12013
30-Nov-15 1:36am
View
http://s13.postimg.org/4on5de73r/Diagram.png
Please follow the diagram url
jagan12013
30-Nov-15 1:09am
View
Error : The INSERT statement conflicted with the FOREIGN KEY constraint "FK__ALBulkTes__UserI__28D80438". The conflict occurred in database "ONLINE", table "ALUser.ALOrganizationUsers", column 'UserID'.
The statement has been terminated.
In the list containing the fileds of ALBulkTestResult are coming and these two tables like as fileds are coming ALLoginOrganization and ALOrganizationUser.
jagan12013
29-Nov-15 14:07pm
View
In the list returning 20 questions and each question having 4 options.
while submitting data i need to save each question answer using the entity framword..
db is a datacontext object.
public ActionResult Solution()
{
List<questionsmodel> items;
decimal testid = 1;
items = (from p in db.ALBulkTestDetails
where p.TestID == testid
select new QuestionsModel
{
ID = p.QuestionID,
SkillId = p.SkillID,
QuestionText = p.Question,
Options = (from a in db.ALBulkTestDetails
join b in db.ALBulkTestDetails
on new { aa = a.QuestionID, a.SkillID } equals new { aa = b.QuestionID, b.SkillID }
where b.QuestionID == p.QuestionID && b.SkillID == p.SkillID
select new Answer
{
AnswerId = b.AnswerId,
Option1 = b.Option1,
Option2 = b.Option2,
Option3 = b.Option3,
Option4 = b.Option4
}).ToList()
}).Take(3).ToList();
return View(items);
}
this is my query returning to the view
while submitting post back list question model, i'm getting error message like
"the insert statement conflicted with the foreign key constraint entity framework"
jagan12013
29-Nov-15 9:14am
View
[HttpPost]
public ActionResult Solution(List Questionsmodel model)
{
if (ModelState.IsValid)
{
ALBulkTestResult obj = new ALBulkTestResult();
var now = DateTime.Now;
var date = new DateTime(now.Year, now.Month, now.Day,
now.Hour, now.Minute, now.Second);
foreach (QuestionsModel ans in model)
{
obj.TestID = ans.TestId;
obj.SkillID = ans.SkillId;
obj.QuestionID = ans.ID;
obj.CandidateAns = ans.SelectedAnswer;
obj.TestDate = date;
}
//db.Entry(obj).State = EntityState.Modified;
db.ALBulkTestResults.Add(obj);
db.SaveChanges();
}
return RedirectToAction("Successfull");
}
this is the right wasy to the save multiple records. Please correct me..
Here i'm getting error
An exception of type 'System.Data.Entity.Infrastructure.DbUpdateException' occurred in EntityFramework.dll but was not handled in user code Additional information: An error occurred while updating the entries. See the inner exception for details.
jagan12013
27-Nov-15 7:14am
View
Tell me according model class and controller how to design in a view for posting submitted answers.
jagan12013
27-Nov-15 6:58am
View
Deleted
@model List<sb_admin_2.web.models.question>
@{
ViewBag.Title = "Successpage";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@using (Html.BeginForm("Successpage", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
<div class="panel-body">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default" id="ques1">
@{int i = 0;}
@foreach (var item in Model)
{
i++;
<div class="panel-heading online-test" role="tab" id="">
@i) @item.QuestionText
</div>
foreach (var opt in item.Options)
{
<div class="panel-collapse">
<div class="panel-body online-test-options">
<div class="input-group">
<div class="col-lg-12" id="radiolist">
@Html.RadioButton(item.ID.ToString(), item.ID) @opt.Option1
</div>
<div class="col-lg-12">
@Html.RadioButton(item.ID.ToString(), item.ID) @opt.Option2
</div>
<div class="col-lg-12">
@Html.RadioButton(item.ID.ToString(), item.ID) @opt.Option3
</div>
<div class="col-lg-12">
@Html.RadioButton(item.ID.ToString(), item.ID) @opt.Option4
</div>
</div>
</div>
</div>
}
<br />
}
</div>
</div>
<div>
<input type="submit" value="Submit Answer" class="btn btn-info btn-lg" />
</div>
</div>
}
[HttpPost]
public ActionResult Successpage(Question model)
{
return View();
}
Show More