troubleshooting Question

LINQ parameters, based on URL string --> ASP.net MVC4 C#

Avatar of finance_teacher
finance_teacher asked on
.NET ProgrammingC#ASP.NETLINQ Query
1 Comment1 Solution648 ViewsLast Modified:
How can I make something like the
below "Create.cshtml" Desired work,
passing search criteria from the URL string ?
---------------------------------------------------------------------------------------------------------------
Current

@model.MWR.Models.MAINT_WORK_REQ

...lots of "MAINT_WORK_REQ" database fields in code, then below....

                 @Html.DropDownList("ProjectID", new List<SelectListItem>
                 {
                    new SelectListItem{ Text="CST031 - LeftHand", Value = "CST031 - LeftHand" },
                    new SelectListItem{ Text="CST031 - RightHand", Value = "CST031 - RightHand" }
                 }
                 )
.......
---------------------------------------------------------------------------------------------------------------
Desired


@model.MWR.Models.MAINT_WORK_REQ

...lots of "MAINT_WORK_REQ" database fields in code, then below....

                 @Html.DropDownListFor("ProjectID", new List<SelectListItem>
                 {
                    display all values from my existing C# 
                    GLOBAL "MWR.Models.Lookup_ProjectID" table
                        select ProjectID
                        from Lookup_ProjectID
                        where ProgramID = 'ABCcorp' // from URL string --> http://localhost:63802/ABCcorp/MAINT_WORK_REQ/Create
                        and active <> 0 // excludes inactive
                 }
                 )

.......
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros