我有一个单选按钮列表,当用户选择一个按钮时,页面会重新加载并出现正确的信息,但按钮消失了。
有没有办法避免这种情况?
这是HTML:
<div class="checkBoxesColumn">
<label><input class="videoWallRadioCls" name="videoWallRadio" type="radio" id="viewAll" value="0" runat="server" />View All</label>
<label><input class="videoWallRadioCls" name="videoWallRadio" type="radio" id="journey" value="1" runat="server" />My MBC Journey</label>
<label><input class="videoWallRadioCls" name="videoWallRadio" type="radio" id="challenges" value="2" runat="server" />Challenges</label>
<label><input class="videoWallRadioCls" name="videoWallRadio" type="radio" id="advice" value="3" runat="server" />Positive Outlooks & Advice</label>
<label><input class="videoWallRadioCls" name="videoWallRadio" type="radio" id="thanks" value="4" runat="server" />Giving Thanks</label>
<label><input class="videoWallRadioCls" name="videoWallRadio" type="radio" id="perspective" value="5" runat="server" />Family / Friend Perspective</label>
</div>
这是代码隐藏:
protected void Page_Load(object sender, EventArgs e)
{
// HIDE UNTIL 10/13
if (DateTime.Now > new DateTime(2012, 9, 12))
{
mbcRadioList.Visible = true;
}
video myVideo = new video();
string categoryID = "0";
if (!string.IsNullOrEmpty(Request["category_id"])) categoryID = Request["category_id"];
Hashtable ht = myVideo.ListingForWall(categoryID);
//Response.Write("Test: " + ht.Count);
//Response.Write("Test: " + ht["B-01"]);
StringBuilder myStringbuilder = new StringBuilder();
for (int i = 1; i <= 36; i++)
{
string iStr = i.ToString();
if (iStr.Length == 1) iStr = iStr.PadLeft(2, '0');
//Response.Write("A-" + iStr + "<br />");
//Response.Write("TEST: " + ht["A-" + iStr] + "<br />");
string videoClass = "videoWallThumb thumb" + iStr;
if (ht["A-" + iStr] != null)
{
string[] tmp = ht["A-" + iStr].ToString().Split('|');
if (tmp[2] == "0") videoClass += " disabled ";
myStringbuilder.AppendLine("<a class=\"" + videoClass + "\" href=\"videoWallDetail.aspx?video_id=" + tmp[0] + "\"><img src=\"images/video_images/" + tmp[1] + "\" alt=\"\"/></a>");
}
else
{
videoClass += " incomplete ";
myStringbuilder.AppendLine("<a class=\"" + videoClass + "\" href=\"#\"><img src=\"images/placeholder.jpg\" alt=\"\"/></a>");
}
}
mosaicA.Text = myStringbuilder.ToString();
}
如果我提供的代码不够或令人困惑,请告诉我,我正在努力解决这个小问题,以便继续处理下一个问题。
提前致谢!