Hi,@Anjali Agarwal,you could send an ajax call as below to hit the hander in your page model and update the page on success
<div id="mydiv">
</div>
<script>
function onChange(e) {
var dropdownlist = $("#Awards").data("kendoDropDownList");
var text = dropdownlist.text();
$(".award").text(text);
alert(text);
var url = "YourPage?handler=partial&text="+text ;
$.ajax({
url: url,
method :"GET" ,
success:function(result){
$("#mydiv").html(result)
}
})
}
</script>
Handler in your page model:
public class YourPageModel : PageModel
{
//other handler
.......
public IActionResult OnGetPartial(string text)
{
//pass the viewmodel contains the text to your razor view
return Partial("Partial",yourviewmodel);
}
}
Add a RazorView (notice not RazorPage)named Partial in your Pages folder
make the judegement in your RazorView(You could also make the judegment in the handler and return different partial view):
@if(Model.SomeProperty...... )
{
.....
}
else
{
........
}