Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7758315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:19:38+00:00 2026-06-01T13:19:38+00:00

I’m currently working on my first MVC3 application at work (using the Razor view

  • 0

I’m currently working on my first MVC3 application at work (using the Razor view engine), and decided to use the open source Telerik Q1 2012 controls since they will provide a lot of the functionality I need (and look nice as well). Right now the issue I’m having is using the Telerik Editor control and binding to my view model. I have standard Html.EditorFor() controls on the page that return the value in the ViewModel correctly, but the property bound to Telerik Editor is null. Their documentation is completely useless (it only mentions EditorFor one time), and it doesn’t seem like they answer too many questions on the forum either. My main question is, how do I bind the Telerik MVC3 Editor to a model and have it set the property that’s bound to it? My code for the view model is below (thanks for any help you can provide, and keep in mind, I’m brand new to MVC, I’m doing this project on my own to get familiar with it and introduce some new technologies to the group):

public class SupportViewModel
{
    [Display(Name = "Ticket Subject")]
    [MaxLength(30)]
    [Required(ErrorMessage = "The ticket subject is required.")]
    public string TicketSubject { get; set; }

    [Display(Name = "Support Issue")]
    [Min(1, ErrorMessage = "You must select a support issue.")]
    public int SupportIssueID { get; set; }

    [Display(Name = "Ticket Priority")]
    [Min(1, ErrorMessage = "You must select a ticket priority.")]
    public int TicketPriorityID { get; set; }

    //public string EmployeeID { get; set; }
    public bool IsClosed { get; set; }

    [Required(ErrorMessage = "The detail message is required.")]
    public string DetailMessage { get; set; }
}

View Code:

@model RadixMVC.ViewModels.SupportViewModel

@{
    ViewBag.Title = "Create New Support Ticket";
}

<h2>Radix Support: Create New Support Ticket</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset style="width: 500px">
        <legend>Create New Support Ticket</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.TicketSubject)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TicketSubject)
            @Html.ValidationMessageFor(model => model.TicketSubject)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SupportIssueID)
        </div>
        <div class="editor-field">
            @Html.DropDownList("SupportIssueID", string.Empty)
            @Html.ValidationMessageFor(model => model.SupportIssueID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TicketPriorityID)
        </div>
        <div class="editor-field">
            @Html.DropDownList("TicketPriorityID", string.Empty)
            @Html.ValidationMessageFor(model => model.TicketPriorityID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IsClosed)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IsClosed)
            @Html.ValidationMessageFor(model => model.IsClosed)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DetailMessage)
        </div>
        <div class="editor-field">  
            @*@Html.EditorFor(model => model.DetailMessage)*@
            @Html.ValidationMessageFor(model => model.DetailMessage)

            <br />

            @{ Html.Telerik().EditorFor(model => model.DetailMessage)
                   .Name("DetailMessageEditor")
                   .HtmlAttributes(new { style = "height: 200px" })
                   .Encode(false)
                   .Render();
            } 
        </div>

        <div>
            <br />
            <input type="submit" value="Create Ticket" title="Submits a new support ticket" />
            <input type="submit" onclick="parent.location='@Url.Action("Index", "Support", "Index")'" value="Cancel" title="Return to Support Home" />
        </div>
    </fieldset>
}

And finally, Controller Code:

    [HttpPost]
    public ActionResult Create(SupportViewModel vm)
    {
        if (ModelState.IsValid)
        {
            SupportTicket SupportTicket = new SupportTicket()
            {
                SupportTicketID = Guid.NewGuid(),
                EmployeeID = "123456",
                TicketOpenDate = DateTime.Now,
                TicketModifiedDate = DateTime.Now,
                IsClosed = vm.IsClosed,
                TicketSubject = vm.TicketSubject,
                SupportIssueID = vm.SupportIssueID,
                TicketPriorityID = vm.TicketPriorityID
            };

            TicketDetail TicketDetail = new TicketDetail()
            {
                TicketDetailID = Guid.NewGuid(),
                SupportTicketID = SupportTicket.SupportTicketID,
                TicketOrder = 1,
                EmployeeID = "123456",
                DetailDate = DateTime.Now,
                DetailMessage = vm.DetailMessage
            };

            SupportTicket.TicketDetails.Add(TicketDetail);
            db.SupportTickets.Add(SupportTicket);
            db.SaveChanges();
            return RedirectToAction("Index");  
        }

        ViewBag.SupportIssueID = new SelectList(db.SupportIssues, "SupportIssueID", "Name", vm.SupportIssueID);
        ViewBag.TicketPriorityID = new SelectList(db.TicketPriorities, "TicketPriorityID", "Name", vm.TicketPriorityID);

        return View(vm);
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:19:40+00:00Added an answer on June 1, 2026 at 1:19 pm

    I was able to get this working. The documentation is either very outdated or just doesn’t explain how to do this very well (probably both). But I was able to get this working by making the following change to my Razor syntax:

            <div class="editor-label">
            @Html.LabelFor(model => model.DetailMessage)
        </div>
        <div class="editor-field">  
            @*@Html.EditorFor(model => model.DetailMessage)*@
            @Html.ValidationMessageFor(model => model.DetailMessage)
    
            <br />
    
            @{ Html.Telerik().EditorFor(model => model.DetailMessage)
                   //.Name("DetailMessageEditor")
                   .HtmlAttributes(new { style = "height: 200px" })
                   .Encode(true)
                   .Render();
            } 
        </div>
    

    Removing the “Name” property from the control solved the problem of not getting anything back, but when I tried to save, I immediately got an error (something to do with XSS, cross-site scripting), and I assumed it was because the HTML wasn’t being encoded. I changed the Encode property to true, and now all is good.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
We're building an app, our first using Rails 3, and we're having to build
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.