<asp:TextBox ID="tb" runat="server" SkinID="forFormSingleLine" ReadOnly="true"></asp:TextBox>
<asp:Button ID="btn" runat="server" Text="Button" onclick="btn_Click" Visible="false" />
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
tb.Attributes["onclick"] = "window.showModalDialog(\"http://www.cnblogs.com/PublicInfo/FrmContractListDlg.aspx"
+ " \",\" \",\"status:false;dialogWidth:800px;dialogHeight:530px\");";
tb.Attributes["onclick"] += ClientScript.GetPostBackEventReference(btn, null);
}
}
protected void btn_Click(object sender, EventArgs e)
{
//to do smth...
}