我的数据绑定在datalist中,里面有个LinkButton回复按钮,我希望我点击回复后不刷新页面,可以吗,但是实现同样的功能。
我的代码:
protected void dl_letter_ItemCommand(object source, DataListCommandEventArgs e)
{
//回复
if (e.CommandName == "replay")
{
temp = e.CommandArgument.ToString ();
txt_Content.Focus();
txt_Content.Text = temp; }
}
请高手帮忙。
我的代码:
protected void dl_letter_ItemCommand(object source, DataListCommandEventArgs e)
{
//回复
if (e.CommandName == "replay")
{
temp = e.CommandArgument.ToString ();
txt_Content.Focus();
txt_Content.Text = temp; }
}
请高手帮忙。
看着办了.
http://www.cnblogs.com/insus/articles/2081521.html
http://www.cnblogs.com/insus/articles/2036884.html
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton btn = (LinkButton)e.Row.FindControl("LinkButtonName");
string Str = gvGW1.DataKeys[e.Row.RowIndex].Values["FieldName"].ToString();
if (btn != null)
{
string surl = "你要跳到的连接";
btnSignIn.OnClientClick = surl;
}
{
//回复
if (e.CommandName == "replay")
{
temp = e.CommandArgument.ToString ();
txt_Content.Focus();
txt_Content.Text = temp; return false; }
}
加个return false 它就不会刷新页面啊