我觉得可能通过xml来实现了。你将你的功能分解成几个小功能。在客户端分别调用不同的功能就可了。
javascript+xml

解决方案 »

  1.   

    http://www.aspxcontrol.com/中有一个控件叫WebMessageBox,为一款使用方便的服务器端提示对话框控件,在服务器端可以得到用户选择的返回值,以便判断程序的下一步流向,可以下载试试。
      

  2.   

    不难,就用javascript,可以用showModalDialog()弹出一个对话框,然后用window.DialogArgument取得对话框的返回值,然后再判断执行
      

  3.   

    To:diaopeng,能给个实例吗?我没有用过SHOWModaldialog
      

  4.   

    建议写一个ConfirmedButton服务器控件,我有一点思路,仅作参考:public class ConfirmedButton : System.Web.UI.WebControls.Button
    {
    private string m_strConfirmText;
    private string m_strOnClick;
    public  ConfirmedButton()
    {
    this.BorderStyle=BorderStyle.Groove;
    }
    public string ConfirmText
    {
    get { return m_strConfirmText; }
    set
    {
    // 显示文字
    m_strConfirmText = value; // 建立验证javascript语句 StringBuilder ConfirmScript = new StringBuilder("return confirm('");
    ConfirmScript.Append(m_strConfirmText);
    ConfirmScript.Append("');");
    if ( base.CausesValidation )

    {
    StringBuilder CompleteScript = new StringBuilder();
    CompleteScript.Append("var flag=true;");
    CompleteScript.Append("if (typeof(Page_ClientValidate) == 'function') flag = Page_ClientValidate();");
    CompleteScript.Append("if (flag==false) return false;"); 
    CompleteScript.Append( ConfirmScript.ToString() );
    m_strOnClick = CompleteScript.ToString();
    }
    else
    {
    m_strOnClick = ConfirmScript.ToString();

    }
    } /// <summary> 
    /// Render
    /// </summary>
    /// <param name="output"> The HTML writer to write out to </param> override protected void Render(HtmlTextWriter writer)

    writer.Write("<input");
    writer.WriteAttribute("type", "submit", false);
    writer.WriteAttribute("name", base.ClientID, true);
    writer.WriteAttribute("id", base.ClientID, true);
    writer.WriteAttribute("value", base.Text, true);
    writer.WriteAttribute("runat","server");
    writer.WriteAttribute("clip","rect( )",true);
    writer.WriteAttribute("color","#000000",true);
    writer.WriteAttribute("style","border-style:Groove",true);
    writer.WriteAttribute("background-color","#ffffff",true);

    writer.WriteAttribute("onclick", m_strOnClick, false);

    writer.Write(" />"); }
    }
      

  5.   

    问题是在客户端要有一个窗口来决定最终执行那一段代码,事件是由客户来触发的。
    我认为只能用js + xml
    来实现。
      

  6.   

    可以判断用户选择的://新实例
    ConfirmedButton btn = new ConfirmedButton();
    btn.ConfirmText = "确定要删除吗?";
    btn.CommandName = "Click";//然后重写OnBubbleEventprotected override bool OnBubbleEvent(object source, System.EventArgs e)
    {
    bool handled=false;
    if(e is CommandEventArgs )
    {
    CommandEventArgs ce=(CommandEventArgs)e;
    if(ce.CommandName=="Click")
    {
    OnClick(ce);
    handled=true;
    } } return handled;
    } protected virtual void OnClick (EventArgs e)
    {
    if (Click != null)
    {
    Click(this,e);
    }
    }这样的话,按“确定”就会post页面