开发者

Request.Form for DropDownList

I have on my view:

</td>
  <td class="span-8 last">
    <div class="editor-label">
        <label for="Traslado_Movimiento_UbicacionFuncional_Id">Ubicaci&#243;n Funcional</label>
    </div>  
     <div class="editor-field">  
       <select id="Traslado_Movimiento_UbicacionFuncional_Id"                 name="Traslado.Movimiento.UbicacionFuncional_Id"><option value=""> -- Seleccione -- </option>
          </select>
    </div>                        
</td>

And I want to get the selected value on the select.

On my controller I wrote:

string selecte开发者_StackOverflowd = Request.Form["Traslado_Movimiento_UbicacionFuncional_Id"];

But selected is always NULL....

Please, help!

Thx


You need to pass the input's name, which contains .s.


As mentioned, you would need to add the runat="server" attribute. But why are you using the HTML select control if you want to use this from server code? It seems to make a lot more sense to use the ASP.NET combobox.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜