views:

156

answers:

1

I've got a small linkbox on the side of my page that is rendered as a PartialView.

In it I have a dropDownlist the should change the routing value of the links in the box but I'm having difficulty doing so.

My current plan is to call on something similar to a Ajax.ActionLink to reload the partial view into the with a different parameter based on the value of the dropdown selection.

However I'm having multiple problems with this, for example as a novice in using dropdownlists I have no idea how to call on the selected value for example.

<%= Html.DropDownList("DropDownList1", new SelectList(Model, "ID", "Name"), "--Pick--", new { AutoPostBack = "true", onchange = "maybe something here" })%>

I tried putting in the sys.mvc.AsyncHyperlink into the onchange attribute and that worked except I don't know how to put in the route value for it.

Sys.Mvc.AsyncHyperlink.handleClick(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, updateTargetId: 'SmallMenu' }

Is there no straight Ajax drop down list that fires events onchange?

Any way this is possible?

I have later in the Partial view the Ajax actionlinks but they need to have their id's updated by the value in the dropdownlist and if I could do that somehow else I would appreciate a suggestion.

A: 

OK had kinda forgot about this.

I found a solution that solved some of the problems and can possibly solve all of them.

As a newbie in MVC and Ajax I later figured that I could put the DropDownList into a Ajax.BeginForm that would post the result of the dropdownlist. I didn't get it to autopostback probably cuause i didn't spend to much time on it.

Ingó Vals