Asp.net 如何在文本框上设置值

Asp.net 如何在文本框上设置值,asp.net,Asp.net,在Asp.NETC#VS08上工作 无标题页 var-styleToSelect; 函数onOk(){ document.getElementById('GridView1')。className=styleToSelect; } 函数GetRowValue(val){ //警报(val); document.getElementById(“Text1”).value=val; //用于最小化代码的硬编码值。 //ControlID可以作为查询字符串传递给弹出窗口 //window.opene

在Asp.NETC#VS08上工作


无标题页
var-styleToSelect;
函数onOk(){
document.getElementById('GridView1')。className=styleToSelect;
}
函数GetRowValue(val){
//警报(val);
document.getElementById(“Text1”).value=val;
//用于最小化代码的硬编码值。
//ControlID可以作为查询字符串传递给弹出窗口
//window.opener.document.getElementById(“ctl00\u contentplaceholder 2\u GridView1\u txtCOM\u NAME”).value=val;
//window.opener.document.getElementById('%=txtCOM_NAME.ClientId%>')。value=val;
//window.opener.document.getElementById(“txtParent”).value=val;
//Text1.innerHTML=val;
//警报(val);
//window.close();
}
函数Hello()
{
document.getElementById(“Text1”).value=“2”;
}
请单击以选择其他文本样式。








弹出后。要在弹出网格上选择一行,然后单击“确定”按钮,并将值放在父网格的文本框中。如何在父网格上设置值。

我想您应该使用网格的行命令事件处理程序,如果我没弄错的话:

OnRowCommand="RowCommand"
然后,可以向网格中添加一个按钮:

<asp:LinkButton ID="LnkButton" runat="server" CommandName="setValue" CommandArgument='<%# Eval("id")%>'>Set value</asp:LinkButton>

如果我没有弄错的话,我想您应该使用网格的row命令事件处理程序:

OnRowCommand="RowCommand"
然后,可以向网格中添加一个按钮:

<asp:LinkButton ID="LnkButton" runat="server" CommandName="setValue" CommandArgument='<%# Eval("id")%>'>Set value</asp:LinkButton>