Monday, 9 September 2013

Altering Url with onclick tag in btn

Altering Url with onclick tag in btn

I used the following in one view in order to navigate to a specific tab on
an Index view...
button type="button" class="btn blue"
onclick="location.href='Index/#rooms'"><i class="m-icon-swapleft
m-icon-white"></i> Back to Room List</button>
The Url reads like.....ReferralTarget/Index/#rooms
rooms being one of the tabs on the Index view..
<li><a href="#rooms" data-toggle="tab">Rooms</a></li>
<div class="tab-pane" id="rooms">
When I use the same code in another view, I get an error 400 - Bad request
and the Url reads like... /ReferralTarget/EditRoom/Index/#rooms
Is there a way of altering the url to remove text, in this case "Edit
room"..??
If it's related back to the controller, the only difference in the two
views is the EditView Get ActionResult uses a (string id), where the
AddView does not....
Thanks

No comments:

Post a Comment