Initialiseur de l'objet routeValues sur Fonction ActionLink
J'ai un problème avec l'élément routevalue pour la fonction ActionLink
Voici mon code
Code:
1 2 3 4 5
|
function change_value(id) {
var q = id.options[id.selectedIndex].value;
return q;
} |
ça c'est la fonction qui me retourne l'élément sélectionné sur une dropdownlist
Ensuite au niveau de la page vbhtml j'ai ça:
Code:
1 2 3 4
|
@Html.DropDownList("toto", "Choisisez une chaine")
<p>@Html.ActionLink("Rechercher", "Index", "Diffusion", New With {.id = "change_value(toto)"}, Nothing)</p> |
et au niveau du contrôleur:
Code:
1 2 3 4 5
|
Function Index(ByVal id As String) As ActionResult
Dim uneListeDif = (From d In contextDif.Diffusion Where d.CH_CLE = CInt(id) Select d).Take(10).ToList
Return View(uneListeDif)
End Function |
La fonction change_value elle marche mais quand je l'utilise pour initialiser l'objet routevalue elle ne retourne pas de valeur.
Merci de votre aide.