开发者

Request.Form for DropDownList

开发者 https://www.devze.com 2023-01-31 07:49 出处:网络
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</labe

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

精彩评论

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