Yacine Ben Slimene
Yacine Ben Slimene

Reputation: 135

Ajax.ActionLink creating unwanted link

In my second navigation bar, I have many Ajax links which I created like this:

<li><a [email protected]("AVPartial", "SecurityProfiles",new AjaxOptions{UpdateTargetId = "SPContainer"})><span>Antivirus</span></a></li>

The problem is when clicking these links I get the following error:

A potentially dangerous Request.Path value was detected from the client (<).

And the link i am redirected to is : http://localhost:8680/SecurityProfiles/%3Ca as the %3Ca is a inferior character (<).

Can anyway explain why is this happening and how to fix it ?

Upvotes: 0

Views: 36

Answers (1)

Muhammed Shevil KP
Muhammed Shevil KP

Reputation: 1396

why include <a> tag?

ActionLink itself creates the tag

<li>
  @Ajax.ActionLink("Antivirus", "SecurityProfiles",new AjaxOptions{UpdateTargetId = "SPContainer"})>
</li>

EDIT:

First argument to @Ajax.ActionLink() is Text to display

Upvotes: 1

Related Questions