我是.net 不是java 不過應該都是同樣道理吧。
<input type="checkbox" name="chkUser" value="1" <%=_checked %> />記住用戶名
在後臺聲明一個字符串變量,protected string _checked = ""; 默認爲空,
需要選中時_checked = "checked=\"checked\"";
把整個checked=“checked” 當作字符串變量綁定到前臺頁面就可以了。
在前臺input中加入 runat="server" 在後臺中String ss = Request.Form["start"];
未完待續。。。。 常用的基本控件 CheckBox ImageView 常用的屬性 代碼示例 ListView ListView的簡單用法 A