HTML Forms used as a filter

Hi,

I am trying to move some code from V13 to V17 , the form is used as a filter

The following code works in V13

I tried this code in V17, the URL updates when the get request fires but the page is not updating. Is there any sort of Cache Issue or other Securety isssue in Later version of .Net core.

I also tried this.

@{
	if (categories.Any())
	{
	
		<form id="catSelector" name="catSelector">
			<select name="newsCategory" id="newsCategory">
				<option value="0">All</option>
				@foreach (IPublishedContent category in categories)
				{
					string selected = "";
					if (!string.IsNullOrWhiteSpace(newsCategory) && newsCategory != "0")
					{
						if (category.Name == newsCategory)
						{
							selected = "selected";
						}
					}

					@if (selected == "selected")
					{
						<option value="@category.Name" selected>@category.Name</option>
					}
					else
					{
						<option value="@category.Name">@category.Name</option>
					}
				}
			</select>

			<button type="submit">Apply Filter</button>
		</form>
	}

}
<script type="text/javascript">
	 $(document).ready(function() {	

		 $('form').on('submit', function(event) {
			 event.preventDefault();
			 var c = $('#newsCategory').val();
			 var url="@Url?category=" +c;
			window.location.href = url;
			 
			 
		});
	});
</script>

But again it still not refreshing the page.

Any Suggestions