我有一个问题:在我的源代码中,我给了我的标签一个id
and :runat
<p>
<p style="border-style:solid" id="p1" runat="server" > Hello</p>
但是当我尝试运行这段代码时:
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
p1.Style.Add(HtmlTextWriterStyle.BorderColor,"" + DropDownList2.SelectedItem.Text + "")
}
这也不起作用:
protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
{
p1.Style.Add(HtmlTextWriterStyle.BorderColor,"Blue");
}
请帮忙?