0

View

<a href = "@Url.Action("myaction","mycontrol",new{mycate= item.cate})>
<a>

when server run it will transfer below html

<a href="/mycontrol/myaction/mycate">
</a>

how to let VIEW show absolue url like this

<a href="192.168.1.1:8555/mycontrol/myaction/mycate">
</a>

i read below the url , this need create another class to create url.

How to convert url path to full or absolute url in ASP.NET MVC

have any another way to create absolue url

another way => add some code in view

View

@{string url = "192.168.1.1.:8080"}
<a href = "@[email protected]("myaction","mycontrol",new{mycate= item.cate})>
<a>
4
  • 1
    Try this Commented Aug 8, 2017 at 2:22
  • You need to concatenate your string with @url.action and then put that variable in href Commented Aug 8, 2017 at 2:25
  • you mean like this <a href = 192.168.1.1:8080 "@Url.Action("myaction","mycontrol",new{mycate= item.cate})> <a> Commented Aug 8, 2017 at 2:37
  • i solve it , thx a lot Commented Aug 8, 2017 at 3:32

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.