我在一个页面有个gridview,gridview有列放了个按钮,我要点这个按钮,把这行的数据传到一个showModalDialog()页面中去,请问高手怎么实现啊,希望详细点~~·

解决方案 »

  1.   

    序列化此行为XML字符串传递,收到后再反序列化为行对象
      

  2.   

    <script type="text/javascript"> 
            function A(s) 
            { 
                var  str=window.showModalDialog('a.aspx','newwindow','height=300,width=500,top='+(screen.AvailHeight-300)/2+',left='+(screen.AvailWidth-300)/2+',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no'); 
            } 
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) 
        { 
            if (e.Row.RowType == DataControlRowType.DataRow) 
            { 
                    Button btn = e.FindControl("btn1") as Button;
                    TextBox txt =e.FindControl("txt1") as TextBox; 
                    btn.Attributes.Add("onclick", "return A("+txt.Text+")");        
            } 
        } 
      

  3.   


     protected void GVInternshipNews_RowCommand(object sender, GridViewCommandEventArgs e)
            {
                //获取被点击的ImageButton所在的gridviewRow
                GridViewRow gvrow = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
                if (e.CommandName == "MySelect")
                {
                    string jobname = gvrow.Cells[0].Text.ToString();
                    Response.Redirect("ResumeUpload.aspx?jobname=" + Server.UrlEncode(jobname) + "&&pagestatus=select");
                     
                }
            }这是我在girdview里面获取的当前行的值。
    我就不知道怎么开窗了~~~?onclick    function  showModal() 
     { 
      
      if(document.all) //IE 
      { 
       feature="dialogWidth:460px;dialogHeight:284px;center:yes;status:0;scroll:no;menubar:no;location:no"; 
       window.showModalDialog("ResumeUpload.aspx",null,feature); 
      } 
      else 
      { 
        //modelessDialog可以将modal换成dialog=yes 
       feature =" top=200px,left=500px,width=468,height=302,menubar=no,toolbar=no,location=no,"; 
      feature+="scrollbars=no,status=no,modal=yes";  
      window.open('ResumeUpload.aspx','newWin',feature); 
      }  } 我要开窗,又要把值传过来,我就不晓得怎么办了~~~
    请大侠支招 ~~·
      

  4.   

    相信我
    你的gridview按钮是怎么放上去的
    把前台的gridview代码给我
    我能解决问题
      

  5.   

     <asp:GridView ID="GridView1" runat="server" HorizontalAlign="Center" Width="100%"
                                            AutoGenerateColumns="false" CellPadding="0" CellSpacing="0" OnRowCommand="GridView1_RowCommand1">
                                            <Columns>
                                                <asp:TemplateField HeaderText="序号">
                                                    <ItemTemplate>
                                                        <asp:Label ID="Label1" runat="server" Text="<%#(Container as GridViewRow).RowIndex + 1%>"></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="id" HeaderText="id" SortExpression="id" Visible="false" />
                                                <asp:BoundField DataField="name" HeaderText="姓名" SortExpression="name" />
                                                <asp:BoundField DataField="department" HeaderText="部门" SortExpression="department" />
                                                <asp:BoundField DataField="number" HeaderText="数量" SortExpression="number" />
                                                <asp:TemplateField HeaderText="修改">
                                                    <ItemTemplate>
                                                        <input type="button" id="editbtn" value="修改" onclick="Pop(this.idvalue);" idvalue='<%# Eval("id") %>' />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="删除">
                                                    <ItemTemplate>
                                                        <asp:Button ID="btnDelete" runat="server" CommandArgument='<%# Eval("id") %>' Text="删除"
                                                            CausesValidation="False" OnClientClick="return confirm('是否确认删除?')" CommandName="DeleteA" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <RowStyle Height="22px" />
                                            <HeaderStyle BackColor="aliceBlue" Height="25px" />
                                            <AlternatingRowStyle BackColor="aliceBlue" />
                                        </asp:GridView>
      

  6.   

    function Pop(a)
               {
                  var tempnum=Math.random();
                  var ma =  window.showModalDialog("EatEdit.aspx?id="+a+"&num="+tempnum,"","dialogWidth:700px;dialogHeight:400px");
                  window.location.href='EatFirst.aspx';
                 
               }