当前位置: 代码迷 >> ASP.NET >> target属性有关问题
  详细解决方案

target属性有关问题

热度:5612   发布时间:2013-02-25 00:00:00.0
target属性问题
<form id="form1" runat="server" target="_blank">

aspx.cs 可以设置target属性吗? form1.target="_blank"; 好像无效

------解决方案--------------------------------------------------------
protected void Page_Load(object sender, EventArgs e)
{
form1.Target = "_blank";
}
or

protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.Add("onclick", "this.form.target='_newName'");
}

------解决方案--------------------------------------------------------
form1.Attributes.Add("target", "_blank");
------解决方案--------------------------------------------------------
2种 答案了 你想要哪个?
------解决方案--------------------------------------------------------
1楼的+1
------解决方案--------------------------------------------------------
探讨
form1.Attributes.Add("target", "_blank");

------解决方案--------------------------------------------------------
探讨
protected void Page_Load(object sender, EventArgs e)
{
form1.Target = "_blank";
}
or

protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.Add("onclick", "this……

------解决方案--------------------------------------------------------
探讨

protected void Page_Load(object sender, EventArgs e)
{
form1.Target = "_blank";
}
or

protected void Page_Load(object sender, EventArgs e)
{
Button1.Attributes.A……

------解决方案--------------------------------------------------------
探讨
<form id="form1" runat="server" target="_blank">

aspx.cs 可以设置target属性吗? form1.target="_blank"; 好像无效
  相关解决方案