如何使用modelpopup扩展器编辑gridview.但是,按钮在asp.net的gridview外部吗? [英] How to Editing the gridview using modelpopup extender.But the button is outside the gridview in asp.net?

查看:53
本文介绍了如何使用modelpopup扩展器编辑gridview.但是,按钮在asp.net的gridview外部吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

受保护的void popuplink_Click(对象发送者,EventArgs e)
{
试试
{

foreach(gvuser.Rows中的GridViewRow i)
{


RadioButton rb =(RadioButton)i.FindControl(& quot; Radselect& quot;);
if(rb.Checked& amp; amp; rb!= null)
{

txtmodusername.Text = i.Cells [2] .Text;
txtfullname.Text = i.Cells [3] .Text;
txtmodemail.Text = i.Cells [4] .Text;
ddlmodpermission.SelectedItem.Text = i.Cells [5] .Text;
Checkbox3.Visible = i.Cells [6] .Visible;


this.Btn_Modify_ModalPopupExtender.Show();
}
}
}

protected void popuplink_Click(object sender, EventArgs e)
{
try
{

foreach (GridViewRow i in gvuser.Rows)
{


RadioButton rb = (RadioButton)i.FindControl("Radselect");
if (rb.Checked && rb != null)
{

txtmodusername.Text = i.Cells[2].Text;
txtfullname.Text = i.Cells[3].Text;
txtmodemail.Text = i.Cells[4].Text;
ddlmodpermission.SelectedItem.Text = i.Cells[5].Text;
Checkbox3.Visible = i.Cells[6].Visible;


this.Btn_Modify_ModalPopupExtender.Show();
}
}
}

<asp:Button ID="popuplink"

                                runat="server" Text="Modify" OnClick="popuplink_Click" /><cc1:ModalPopupExtender

                                    ID="Btn_Modify_ModalPopupExtender" runat="server" TargetControlID="Btntest" CancelControlID="popupclose"

                                    PopupControlID="Panel2" Enabled="True" DynamicServicePath="" BackgroundCssClass="ModalPopupBG">
                                </cc1:ModalPopupExtender>

When i am debuging,values assign to textbox controls.but popup does not show.

推荐答案

创建一个javascript函数并bing此Javascript函数可用于gridview rowdatabound事件.

使用javascript显示您的modalPopup ...
create a javascript function and bing This Javascript function to gridview rowdatabound event.
and
show your modalPopup using javascript ...


您是否在gridview事件上打开弹出窗口(如果是),则可以将该事件的行ID存储在会话或cookie中.进行相同的代码,但更改"if"中的条件,只需检查i rowid并找到该行的控件,以便您可以在控件中拥有所有值...希望对您有帮助...:- )
are you opening your popup on on gridview event if yes then you can store the row id on that event in session or cookies. do the same code but change the condition in "if" just check the i rowid and find the control of that row so you can have the all value in your controls... hope it will help you......:-)


这篇关于如何使用modelpopup扩展器编辑gridview.但是,按钮在asp.net的gridview外部吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆