从选定的单选按钮列表值调用模式弹出窗口 [英] Call a modal popup from a selected radiobuttonlist value
本文介绍了从选定的单选按钮列表值调用模式弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我成功显示了一个模式的弹出式窗口,该弹出式窗口是通过类似于下面的按钮onClick事件调用的.有没有办法从选定的单选按钮列表值中也调用BtnViewDetails方法(如下)?
I am successfully displaying a modal popup invoked from a button onClick event similar to the one below. Is there a way to also call the BtnViewDetails method (below) from a selected radiobuttonlist value?
protected void BtnViewDetails_Click(object sender, EventArgs e)
{
// get the gridviewrow from the sender so we can get the datakey we need
Button btnDetails = sender as Button;
GridViewRow row = (GridViewRow)btnDetails.NamingContainer;
// extract the customerid from the row whose details button originated the postback.
// grab the customerid and feed it to the customer details datasource
// finally, rebind the detailview
this.sqldsCustomerDetails.SelectParameters.Clear();
this.sqldsCustomerDetails.SelectParameters.Add("customerid", Convert.ToString(this.gvCustomers.DataKeys[row.RowIndex].Value));
this.dvCustomerDetail.DataSource = this.sqldsCustomerDetails;
this.dvCustomerDetail.DataBind();
// update the contents in the detail panel
this.updPnlCustomerDetail.Update();
// show the modal popup
this.mdlPopup.Show();
}
推荐答案
当然可以!
您现在有一个正在处理的处理程序,它会调用模式弹出窗口.一种便宜又肮脏的方法是将对BtnViewDetails_Click()的调用添加到该处理程序.优雅的方法是添加一个自定义处理程序以拦截自定义事件BtnViewDetails_Click事件.我本人会选择简单的方法,但我不是专业的程序员.
Of course you can!
You have a handler working now that calls a modal popup; the cheap and dirty way is to add a call to BtnViewDetails_Click() to that handler. The elegant way is to add a custom handler to intercept the custom event BtnViewDetails_Click event. I''d personally opt for the easy way, but I''m not a professional programmer.
这篇关于从选定的单选按钮列表值调用模式弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文