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 3609304
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:36:38+00:00 2026-05-18T21:36:38+00:00

working in mvc In this Json result i am loading some dropdownlist it is

  • 0

working in mvc

In this Json result i am loading some dropdownlist it is working fine..in that if i select some value description value should be displayed in the textbox….here ViewData[“Description”] = AttributesLibrary.Description; in this i am getting description values but i cant able to display it……

 public JsonResult PopulateGradeScaleSetUp(string trackId)
    {

        List<GradeDivisionValues> GradeDivisionValuesList = new List<GradeDivisionValues>();
        SelectList fieldIds = new SelectList(new List<Gradescale> { });
        AttributesLibrary AttributesLibrary = new AttributesLibrary();

        try
        {
            if (!string.IsNullOrEmpty(trackId))
            {
                string gradescaleID;
                Context.SetPrivilegeContext(GrowthDataConstant.ViewAttributeLibrary);
                AttributesLibrary = GrowthMasterDataProxy.GetAttributeByAttributeId(trackId);
                gradescaleID = AttributesLibrary.AttributePropertyDetails.GradeScaleDetails.Identifier;
                Context.SetPrivilegeContext(GrowthDataConstant.ViewGradeScale);
                Gradescale gradeScale = new Gradescale();
                gradeScale = GrowthMasterDataProxy.GetGradeScaleById(gradescaleID);
                Dictionary<string, GradeDivisionValues> GradeDivisionValuesDic = gradeScale.GradeDivisionValues;
                if (GradeDivisionValuesDic != null && GradeDivisionValuesDic.Count > 0)
                {
                    GradeDivisionValuesList = GradeDivisionValuesDic.Values.ToList();

                }
                fieldIds = new SelectList((IEnumerable)GradeDivisionValuesList, "NumericalValue", "TextValue");
                ViewData["Description"] = AttributesLibrary.Description;
            }
            return Json(fieldIds, JsonRequestBehavior.AllowGet);


        }


        catch (ArgumentException argumentException)
        {
            ExceptionService.HandleException(argumentException, _defaultPolicy);
            return Json("Error", JsonRequestBehavior.AllowGet);
        }


    }

This is my view:

 <%= Html.TextBox("Description", (string)ViewData["Description"])%>
  • 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-05-18T21:36:38+00:00Added an answer on May 18, 2026 at 9:36 pm

    Your controller action returns JSON which makes me to believe that you are invoking it using AJAX. In order to update the value of the textbox you need to include it in the JSON result instead of using ViewData. For example:

    return Json(new
    {
        fieldIds = fieldIds,
        description = AttributesLibrary.Description
    }, JsonRequestBehavior.AllowGet);
    

    Now all that’s left is to use this value in your AJAX success handler. Supposing you are using jquery it might look like this:

    var url = '<%= Url.Action("PopulateGradeScaleSetUp") %>';
    $.getJSON(url, { trackId: 123 }, function(result) {
        $('#Description').val(result.description); 
    });
    

    and the textbox definition simply:

    <%= Html.TextBox("Description") %>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have only recently started working with the MVC approach, so I suppose this
I am working on an MVC site that is the first my company has
I've just started working with ASP.NET MVC now that it's in beta. In my
I am working on an ASP.NET MVC web app that allows people to publish
I'm working in an ASP.NET MVC Beta 1 project, and I've noticed that if
I am working on an ASP.NET MVC application that contains a header and menu
I'm working with ASP.NET MVC but this really applies to any MVC framework. I
I am working on an MVC site that contains overloaded controllers that accept variable
I had a working solution using ASP.NET MVC Preview 3 (was upgraded from a
I'm working my way into MVC at the moment, but on my To learn

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.