# Blazor Navigation

The below shows ways to navigate other than using the menu.

### Routing for Pages

The routing generally goes at the top of the razor file.

```csharp
//In the razor page:
@page "/pagetonavigateto"

//With a parameter value
@page "/pagetonavigateto/{id:int}"  //if the id is a int there are various types you can use such as bool, string etc.
```

### Using &lt;a&gt; Tags

```csharp
<a href="/pagetonavigateto/parametervalue">Click Here</a>
```

### Using Buttons

In the razor file to navigate from

```csharp
<button class="btn btn-primary" @onclick="Method">Click Here</button>
```

In the razor code section or the base class file

```csharp
void Method()
{
	NavigationManager.NavigateTo("/pagetonavigateto/parametervalue");
}
```

You will also need to inject the NavigationManager into either the razor file or the base class file

```csharp
//In the razor file
@inject NavigationManager NavigationManager

//In the base class file
[Inject]
NavigationManager NavManager { get; set; }
```
