Link to home
Start Free TrialLog in
Avatar of lulu50
lulu50Flag for United States of America

asked on

Not to hard code the path to a link

Hi,

I need your help please

How can I change my code not to have a path in my code.

instead of this '/bcwa/CareAdvanceBusinessRules/'

I want something like this but it doesn't work.

'@Url.Action("ExportToExcel", "CareAdvanceBusinessRules")';


the problem that I have is when I upload my document to the server.
the server has a different path than my local document so I have to manual change the path every time I need to do an upload.

How can I remove the hard code path from my code and replace it with something else?




    function ExportToExcel() {

        $('#GetAction').val("ExportToExcel");

        $('#SearchRulesForm').attr('action', '/bcwa/CareAdvanceBusinessRules/ExportToExcel');

        $('#SearchRulesForm').submit();

    }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of lulu50
lulu50
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial