我需要在點擊按鈕後將@ html.label的值傳遞給控制器「Verificar」的變量「data」。將html.label的值傳遞給控制器
我所做的:
@Html.Label("modalTitle", new { id = "modalTitle" })
<button type="button" class="btn btn-defaultgreen" onclick="location.href = '@Url.Action("Verificar", "Feriado", new { date = @Html.Label("modalTitle", new { id = "modalTitle" }).toString() }, null)'">Create Event</button>
,但沒有工作這種方法....需要你的幫助!感謝
你是什麼意思「@ Html.Label的價值」?標籤不是輸入。從你提供的例子看來,你想要標籤的標記,但爲什麼? – 2014-10-29 22:41:58
becouse我在javascript中使用FullCalendar v1.6.4:case「select」>> $('#modalTitle')。html(start.toString()。substring(0,15));將日期傳遞給@ html.label。現在我需要把這個日期傳給我的控制器。 – 2014-10-29 22:53:44
'@ Html.Label()'給你的財產的名稱,而不是它的值(我假設的日期)。包含您想要傳遞給控制器的日期的控件是什麼? – 2014-10-29 23:02:31