0

I want to create a url which starts with # like localhost:/#somename. Can anyone help me?

i tried with custom route constraint,i did not get

//localhost:/#testing
[Route(@"{x:regex([^#]*)}testing")]
public ActionResult testingyash(string x)
{
  return View();
}

2 Answers 2

1

You cant have a url like that. The # symbol is a Fragment Identifier. Its used by browsers to identify a section in page. Anything following the # is not even sent to the server.

Sign up to request clarification or add additional context in comments.

Comments

0

Why do you need routing for # value? Those are client-side values.

try Url.Action

return Redirect(Url.Action("Index", "Home") + "#testing");

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.