Assigning the Selected value from a DropDownList

2019-08-09 19:44发布

I have an MVC 3 application with the following view:

@model IEnumerable<TRP_MVC_Prototype.Models.usp_TM_Select_ShortName_PIDResult> 
@{
    ViewBag.Title = "Details";
}

<div id="main" style="background-color:White">
    <h1 style="background-color:transparent;color:Blue;">You are logged on as: @ViewBag.Message 

          @Html.DropDownList("shrt_ttl", new SelectList(Model,"short_title","short_title"))    
          @Html.ActionLink("Select", "Details", new { Shrt_title = "" })

    <a style="color:Blue;position:absolute; right:600px" @Html.ActionLink("Create Program Summary", "Index", "User_Guide")  </a>
    <a style="color:Blue;position:absolute; right:350px" @Html.ActionLink("Edit Program Summary", "Index", "User_Guide")  </a>
    <a style="color:Blue;position:absolute; right:150px" @Html.ActionLink("Delete TRP", "Index", "User_Guide")  </a>
    </h1>
    <h1 style="background-color:transparent;color:Blue;">Select TRP to View</h1>
    <h1 style="color:Gray";>______________________________________________________________________________________________________________________________________________________________________________</h1>
</div>

I need to assign the Shrt_title string the return value from the selected value from the DropDownList. It seems to me that the assignment of Shrt_title is what needs to take place but I can't the correct variable to assign to that string. It gets returned to the controller but what to put in the variable is my question I think. TIA Bruce

0条回答
登录 后发表回答