finance_teacher
asked on
Redirect after Lookup ? -- ASP.net MVC 4 C#
How can I get the below
"LookupByWorkOrderNumber.c shtml"
to just do the redirection or do
some other way since users will have the
http://appstest.com/CASTLE/MAINT_WORK_REQ/LookupByWorkOrderNumber/25011
link, but I need to get them to
http://appstest.com/CASTLE/MAINT_WORK_REQ/Edit/176 ?
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -
User Steps
1. user clicks on
http://appstest.com/CASTLE/MAINT_WORK_REQ/LookupByWorkOrderNumber/25011
2. below LOOKUP happens
which returns "176"
SELECT ID
FROM MAINT_WORK_REQ
WHERE (IFSWO = '25011')
3. automatically redirects to
http://appstest.com/CASTLE/MAINT_WORK_REQ/Edit/176
-------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -
Possible Programming Steps ?
1. add below to MAINT_WORK_REQController.c s
public ActionResult LookupByWorkOrderNumber(st ring sabWorkOrderNumber)
{
var myPOs =
(from p in db.MAINT_WORK_REQ
where
p.WorkFlowStage == 3 && p.ID == sabWorkOrderNumber
select p
);
return View(myPOs);
}
2. create LookupByWorkOrderNumber.cs html
** just a page that runs the above CODE and forwards to
http://appstest.com/CASTLE/MAINT_WORK_REQ/Edit/176
"LookupByWorkOrderNumber.c
to just do the redirection or do
some other way since users will have the
http://appstest.com/CASTLE/MAINT_WORK_REQ/LookupByWorkOrderNumber/25011
link, but I need to get them to
http://appstest.com/CASTLE/MAINT_WORK_REQ/Edit/176 ?
--------------------------
User Steps
1. user clicks on
http://appstest.com/CASTLE/MAINT_WORK_REQ/LookupByWorkOrderNumber/25011
2. below LOOKUP happens
which returns "176"
SELECT ID
FROM MAINT_WORK_REQ
WHERE (IFSWO = '25011')
3. automatically redirects to
http://appstest.com/CASTLE/MAINT_WORK_REQ/Edit/176
--------------------------
Possible Programming Steps ?
1. add below to MAINT_WORK_REQController.c
public ActionResult LookupByWorkOrderNumber(st
{
var myPOs =
(from p in db.MAINT_WORK_REQ
where
p.WorkFlowStage == 3 && p.ID == sabWorkOrderNumber
select p
);
return View(myPOs);
}
2. create LookupByWorkOrderNumber.cs
** just a page that runs the above CODE and forwards to
http://appstest.com/CASTLE/MAINT_WORK_REQ/Edit/176
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.