1

我在 HTML 中有一个隐藏的输入字段,它包含 SomeValue:

  <input id="event_id" type="hidden"> SomeValue </input>

我在服务器端需要 SomeValue 。

有我可以使用的 SHtml 方法吗?以下代码应在提交时获取值,加载页面后我需要该值。

"event_id" #> SHtml.onSubmit(id = _)
4

1 回答 1

2

在模板中你可以写

<input id="event_id"></input>

在代码片段中,您可以使用以下SHtml.hidden方法:

SHtml.hidden(() => println("hidden field"))
于 2012-10-08T17:30:06.417 回答