2014-09-25 51 views
-1

弹出显示并消失时showpopup返回它不消失但没有值如果没有返回它显示并消失,但一个我再次点击它显示值,但很快它消失当OnClientClick =“ShowPopup()

<ItemTemplate> 

        <asp:Button ID="btndetails" runat="server" 
         CommandName="ShowPopup" OnClientClick="ShowPopup();return false ;" 

         Text="select issue" /> 
       </ItemTemplate> 

代码背后

protected void GridView1_RowCommand(object sender,GridViewCommandEventArgs e) 
{ 
    if (e.CommandName == "ShowPopup") 
    { 

     Button btndetails = (Button)e.CommandSource; 
     GridViewRow gvrow = (GridViewRow)btndetails.NamingContainer; 
     // lblID.Text = HttpUtility.HtmlDecode(gvrow.Cells[3].Text); 
     // lblID.Text = GridView1.DataKeys[gvrow.RowIndex].Value.ToString(); 
     lblID.Text = gvrow.Cells[2].Text; 
     // lblContactName.Text = HttpUtility.HtmlDecode(gvrow.Cells[3].Text); 
     //txtAddress.Text = gvrow.Cells[5].Text; 
     // txtCity.Text = HttpUtility.HtmlDecode(gvrow.Cells[4].Text); 

    } 

回答

0

OnClientClick属性呈现一个javascript onclick处理到控制的HTML要看看这是什么意思,请尝试以下操作:

OnClientClick="alert('this is a javascript method, and will not execute in C#')" 

您问题的其余部分的语言相当混乱。你能否澄清你正在努力完成的事情?