Click here to Skip to main content
15,881,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
My Cancel button is in User Controller. If I click cancel button and the role is 001,
it can't find the url of User/MT_ADMIN/UserList.
I want to remove User and how do I directly go to MT_ADMIN/UserList.
C#
var role = document.getElementById("userRole").innerHTML;
               if (role == 001)
               {
                   document.getElementById('UserCancel').setAttribute('href', "MT_ADMIN/UserList")
               }
               else
               {
                   document.getElementById('UserCancel').setAttribute('href', "Index")
               }
Posted
Updated 24-Mar-15 22:39pm
v2
Comments
Mohibur Rashid 25-Mar-15 5:36am    
This question does not have enough information to answer.
Nathan Minier 25-Mar-15 8:09am    
So Controller is UserController, Action is MT_ADMIN, and argument is UserList?
code icecream 25-Mar-15 21:34pm    
No, Controller is UserController, Another Controller is MT_ADMIN and its action is UserList

1 solution

Use this
JavaScript
var role = document.getElementById("userRole").innerHTML;
               if (role == 001)
               {
                   document.getElementById('UserCancel').setAttribute('href', "../MT_ADMIN/UserList")
               }
               else
               {
                   document.getElementById('UserCancel').setAttribute('href', "Index")
               }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900