Tanlangan qiymatni Razor yordamida MVC versiyasi uchun DropDownList-dan bog'lash

Men ishlaydigan Ko'rinishim bor, lekin DropDownList-dan tanlangan qiymatni qanday qilib olishni tushunolmayman:

@model IEnumerable<trP_MVC_Prototype.Models.usp_TM_Select_ShortNameResult>
@using System.Web;
@using System.Web.WebPages;
@using System.Web.Mvc;  

@{
    ViewBag.Title = "Details";
}
@using (Html.BeginForm("Details", "ProgramSummary", FormMethod.Post, new { id = "Details" }))
{
<div id="main" style="background-color:White">
        

You are logged on as: @ViewBag.Message DrpDwnLst @Html.DropDownList("Short_Title", new SelectList(Model, "short_title", "short_title"), "--Select One--"). @Html.ActionLink("Select","Details",new { Shrt_title = ""}) @Html.ActionLink("Create Program Summary", "Index", "User_Guide") @Html.ActionLink("Edit Program Summary", "Index", "User_Guide") @Html.ActionLink("Delete TRP", "Index", "User_Guide")

 
        

Select TRP to View

        

______________________________________________________________________________________________________________________________________________________________________________

}

The DropDownList displays correctly but I don't know how to return the Selected value in the ActionLink. In the action link the third parameter passes the value back to the controller it currently has "" but I would like to figure out how to reference the selected value instead.

1
Men sizni izlamayman. Dastlab siz tanlagan qiymatni DropDown-dan olishni xohlayotganingizni bildirasiz, lekin oxirida siz harakatlanish havolasi haqida gapirasiz.
qo'shib qo'ydi muallif Paulo Abreu, manba
qo'shib qo'ydi muallif Darin Dimitrov, manba
qo'shib qo'ydi muallif RickAndMSFT, manba
Tanlangan qiymatni hozirda "yangi {Shrt_title =" "}" ishlov berish "parametrining uchinchi parametrida" item.short_title "kabi bir narsa bilan almashtirishni xohlayman
qo'shib qo'ydi muallif user1011441, manba
Xuddi shu muammo. Agar bu imkon bo'lmasa, menga xabar bering. Muammoni so'zlayman deb o'yladim. @Darin Dimitrov
qo'shib qo'ydi muallif user1011441, manba
Agar ahmoq deb o'ylayotgan bo'lsangiz, iltimos, menga xabar bering. Men xafa emasman, men javob istayman. Rahmat sizga Bruce
qo'shib qo'ydi muallif user1011441, manba

2 javoblar

0
qo'shib qo'ydi

Bu mening javobim

    @Html.DropDownList("short_name", ViewBag.DetailsList as SelectList, "--Select One--", new { onchange = "dofunction(this.form.short_name);" });
    function dofunction(dropdown) {
        debugger;
        for (i = 0; i < 194; i++) {
            if (dropdown[i].selected == true) {
                var Shrt_ttls = dropdown[i].value.toString()
                //document.getElementById("shrtLst").value = Shrt_ttls;

                $.ajax({
                    url: "/ProgramSummary/Details?Shrt_titles=" + Shrt_ttls,                 
                    type: 'Post',                 
                    data: Shrt_ttls,                 
                    success: function(result) { 
                        alert( "Short Name is: " + Shrt_ttls);//process the results from the controller action                 
                    },             
                    error: function() {
                         alert ( "no deal");
                    }
                });  
            }
        }
        return true;
     }

Bu qiymat JavaScript funktsiyasidan Indeks uchun HTTPPost-ga qaytadi. Rahmat, Bryus

0
qo'shib qo'ydi