15,895,965 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 ZainNabi (Top 21 by date)
ZainNabi
3-Jan-19 13:14pm
View
It does not work still and I get the same error
ZainNabi
5-Oct-18 9:13am
View
The distinct does not work because there are not duplicate values in my database. Also I don't want to group because each value is unuqie
ZainNabi
19-Aug-14 7:34am
View
I have basically 3 values:
*Sheep
*Camel
*Ox
if I select Ox it must redirect to the Ox partial view and populate a read-only textbox with Ox
else if Camel selected it must redirect to the Ox partial view and populate a read-only textbox with Camel
ZainNabi
18-Aug-14 13:36pm
View
Maybe you can help me with my other question??
I have a drop down with certain values
<pre lang="cs">@using (Html.BeginForm())
{
@Html.DropDownList("Animal Type",
new SelectList((System.Collections.IEnumerable) ViewData["Animal"], "animal_type"))
}</pre>
my controller action for that method is
<pre lang="sql">[HttpGet]
public ActionResult create()
{
var animal = from x in db.Animals
select x.animal_type;
ViewData["Animal"] = animal;
return View();
}</pre>
After selecting a value from the drop down it should display the specific partial view on the same view
ZainNabi
18-Aug-14 12:28pm
View
Thank you. It does assign the role to the user. What I need to do now is navigate to a specific view with a layout for that role. Any ideas
ZainNabi
12-Aug-14 9:10am
View
As per the link above, I see that FormsAuthentication is being used rather that identity
ZainNabi
28-Apr-14 12:00pm
View
In my view I have the following code for a drop downlist<br><br>
<br><br>
@{<br><br>
ViewBag.Title = "SelectCategory";<br><br>
Layout = "~/Views/Shared/_Layout1.cshtml";<br><br>
}<br><br>
<br><br>
Select Category
<br><br>
@using(Html.BeginForm())<br><br>
{<br><br>
<p>@Html.DropDownList("Roles", (IEnumerable<SelectListItem>)ViewData["Roles"])</p><br><br>
<input type="submit" value="Step 2" /><br><br>
}<br><br>
<br><br>
The error I get when I select the individual property is this > An exception of type 'System.InvalidOperationException' occurred in System.Web.Mvc.dll but was not handled in user code<br><br>
<br><br>
<br>
<br>
Additional information: There is no ViewData item of type 'IEnumerable<SelectListItem>' that has the key 'Roles'.
ZainNabi
6-Sep-13 11:11am
View
public ActionResult Index()
{
MembershipUser membershipUser = Membership.GetUser();
int userID = (int)membershipUser.ProviderUserKey;
var query = from x in db.Ques
where x.UserId=userID
select new
{
x.Q_Description
};
return View(query.ToList());
}
These are my model classes
public class Que
{
[Key]
[Display(Name = "Queue ID")]
public int ID { get; set; }
[Display(Name = "Queue Description")]
public string Q_Description { get; set; }
[Key]
[ForeignKey("UserProfile")]
[System.Web.Mvc.HiddenInput(DisplayValue = false)]
public int UserId { get; set; }
}
[Table("UserProfile")]
public class UserProfile
{
[Key]
[DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]
public int UserId { get; set; }
public string UserName { get; set; }
public string LastName { get; set; }
[EmailAddress]
public string Email { get; set; }
public string Mobile { get; set; }
public virtual ICollection<que> Que { get; set; }
}
ZainNabi
6-Sep-13 10:56am
View
@model IEnumerable<qwingsystem.models.que>
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_LayoutPage2.cshtml";
}
Index
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table>
<tr>
<th>
@Html.DisplayNameFor(model => model.Q_Description)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Q_Description)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
@Html.ActionLink("Details", "Details", new { id=item.ID }) |
@Html.ActionLink("Delete", "Delete", new { id=item.ID })
</td>
</tr>
}
</table>
ZainNabi
6-Sep-13 10:55am
View
Deleted
Index view
@model IEnumerable<qwingsystem.models.que>
@{
ViewBag.Title = "Index";
Layout = "~/Views/Shared/_LayoutPage2.cshtml";
}
Index
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table>
<tr>
<th>
@Html.DisplayNameFor(model => model.Q_Description)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Q_Description)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
@Html.ActionLink("Details", "Details", new { id=item.ID }) |
@Html.ActionLink("Delete", "Delete", new { id=item.ID })
</td>
</tr>
}
</table>
ZainNabi
5-Sep-13 15:16pm
View
How do I show only the currently logged in user he's data on the index view i.e que registrations
ZainNabi
23-Aug-13 11:56am
View
How would I go about coding the above question?
ZainNabi
23-Aug-13 11:54am
View
I am trying to create a queueing system that issues a customer a ticket when he/she interacts with a kiosk. How would I get all the Department names and add them to a view called kiosk as buttons?
ZainNabi
23-Aug-13 11:50am
View
Yes, could you perhaps give me a tutorial
ZainNabi
23-Aug-13 11:47am
View
Yes, could you perhaps give me a tutorial
ZainNabi
23-Aug-13 11:41am
View
Yes I do. What do you mean Filter down by user
ZainNabi
14-Jun-13 2:19am
View
Great solution.
ZainNabi
13-Jun-13 5:15am
View
Question 2
Im trying to create a dynamic numer of textboxes based on the value that the user enters. How do I go about doing this?
Yours Faithfully
ZainNabi
13-Jun-13 5:08am
View
Thank you.
ZainNabi
12-Jun-13 13:50pm
View
The problem occurs when creating a view for the Branch table,I have 2 Html.TextboxFor helpers. One for BranchLocation and the other Manager.An Html.LabelFor helper that will display the CompanyName sent via ViewBag. How do I save all these values entered in the textbox and the ViewBag value to the Branch table
ZainNabi
12-Jun-13 13:15pm
View
Im using EF and my controller looks like this:
public ActionResult RegCompany(Company c)
{
using (var db = new dbQueueing2Entities())
{
var newC = db.Companies.Create();
newC.CompanyName = c.CompanyName;
newC.CompanyEmail = c.CompanyEmail;
newC.CompanyPassword = c.CompanyPassword;
ViewBag.CoName = c.CompanyName;
db.Companies.Add(newC);
db.SaveChanges();
}
return RedirectToAction("RegBranch2", "SetupQueue");
}
Show More