We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding to Razor page model

Thread ID:





146849 Aug 22,2019 03:05 PM UTC Aug 24,2019 04:28 PM UTC ASP.NET Core - EJ 2 1
Tags: Text Box
Mike Johnson
Asked On August 22, 2019 03:05 PM UTC

I don't see how to bind these controls, the textbox for example, to the page model on my Razor page. 

This binds it using standard controls...
<input asp-for="Input.FirstName" class="form-control" />

How do I bind the ejs-textbox to my model?

Narayanasamy Panneer Selvam [Syncfusion]
Replied On August 24, 2019 04:28 PM UTC

Hi Mike, 
Good day to you. 
We have checked your query and have prepared a sample to meet your requirement. Please refer code snippet in below 
@model IndexModel 
    < div id = "textbox-control" > 
        <form method="post"> 
            <ejs-textbox id="textboxfor" name="firstname" placeholder="First Name" floatLabelType="Auto" ejs-for="@Model.firstname"></ejs-textbox> 
</div > 
public string firstname { get; set; } = "John"; 
For your convenience we have prepared a sample using above code, kindly get it from the below link. 
To know more about model binding in razor pages, please refer below UG link 
Please let us know if you need any further assistance on this. 
Narayanasamy P. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon