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

  • Home
  • SEARCH
  • 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 7411291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:21:56+00:00 2026-05-29T06:21:56+00:00

I want to do autopostback to dropdownlist. My form on view: @using (Html.BeginForm(Index, Model,

  • 0

I want to do autopostback to dropdownlist.
My form on view:

@using (Html.BeginForm("Index", "Model", FormMethod.Post))
{
            @(Html.Telerik().DropDownList()
                .Name("ddlBrands")
                .BindTo((IEnumerable<SelectListItem>)ViewData["brands"])
                .ClientEvents(events => events
                                  .OnChange("onDropDownListChange")
                )
            )
            <input type="submit" value="OK" />

    <table style="margin:15px; margin-left:0px;">
        @foreach (var item in Model) {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.FullModel)
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new { id=item.ModelID }) |
                    @Html.ActionLink("Delete", "Delete", new { id=item.ModelID })
                </td>
            </tr>
        }
    </table>
}

and javascript:

<script type="text/javascript">
    function onDropDownListChange(e) {
        SimpleAjaxRequest('/Model/Index', e.value);
    }

    function SimpleAjaxRequest(url, requestData) {
        return $.ajax(
        {
            type: 'POST',
            url: url,
            async: true,
            data: { ddlBrands: requestData },
            dataType: "json",
            traditional: true
        });
    }
</script>

I send Post data via Ajax from Index view to server and after manipulation data I need update data on my form. how I can do it? I’m try redirect to POST action

[HttpPost]
        public ActionResult Index(string ddlBrands)
        {
            SetBrandItems();
            return RedirectToAction("Index", "Model", new {ddlBrands = ddlBrands});
        }

after calling GET action

 public ActionResult Index(int? ddlBrands)
    {
        SetBrandItems();
        List<Model> m = dm.GetModelsByBrandId(ddlBrands).ToList();
        return View(m);
    }

but my page not refresh and url not change and data not updating…
anybody can help me?

  • 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-29T06:21:57+00:00Added an answer on May 29, 2026 at 6:21 am

    The DropDownList change event is ajax operaiton. I think you can not redirect in server-side. But you can add a rediect in the ajax callback.

    eg:

     function SimpleAjaxRequest(url, requestData) {
        return $.ajax(
        {
            type: 'POST',
            url: url,
            async: true,
            data: { ddlBrands: requestData },
            dataType: "json",
            traditional: true,
            success: function() {
                //callback redirect 
                location.href = '/Model/Index';
            }
        });
    }
    
        [HttpPost]
        public ActionResult Index(string ddlBrands)
        {
            SetBrandItems();
            return Json(null, JsonRequestBehavior.AllowGet);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dropdownlist with the autopostback set to true. I want the user
Writing a custom validator for a dropdownlist that is using autopostback. Seems to ignore
want to know why String behaves like value type while using ==. String s1
I have a ASP.Net web page with a grid view. I want to filter
I want to filter DFWP through asp:TextBox. Using Office Designer I added DFWP with
I have the following markup: <asp:DropDownList ID=dd1 AutoPostBack=true runat=server> <asp:ListItem Value=1>1</asp:ListItem> <asp:ListItem Value=2>2</asp:ListItem> </asp:DropDownList>
<asp:UpdatePanel ID=UpdatePanel1 runat=server UpdateMode=Conditional> <ContentTemplate> <div> <asp:DropDownList runat=server EnableViewState=true DataTextField=Name DataValueField=Id DataSourceID=ListSource ID=List OnDataBound=List_OnDataBound
I am currently creating a registration form in asp.net and c#. What I want
I'm working on asp.net website with Vb.net and I have a dropdownlist with autopostback
I have a dropdownlist like this <asp:dropdownlist runat=server autopostback=true onselecteditemindexchanged=fire_event ID=DDL/> and on codebehind

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.