传值问题 我在一个页面有个gridview,gridview有列放了个按钮,我要点这个按钮,把这行的数据传到一个showModalDialog()页面中去,请问高手怎么实现啊,希望详细点~~· 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 序列化此行为XML字符串传递,收到后再反序列化为行对象 <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+")"); } } 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); } } 我要开窗,又要把值传过来,我就不晓得怎么办了~~~请大侠支招 ~~· 相信我你的gridview按钮是怎么放上去的把前台的gridview代码给我我能解决问题 <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> 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'; } textbox 长度 long型怎样转成byte[] 型 提个简单的问题? 母版页页内容页的提示问题 谁有《Visual C#图像处理程序设计实例》这本书的电子版阿 谁知道有好用的word类库 转换dll函数 在C#的textBox或richtextBox中,如何显示图片? 这样为什么错了呀?? 我老觉得xp有内存泄露的情况,我机器3天不关机就要用了600多m的内存 checkBox 和dropDownList 刷新的问题 C#如何隐藏一个外部应用程序的进程名和程序界面(请大虾们帮小弟解决下)
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+")");
}
}
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);
} } 我要开窗,又要把值传过来,我就不晓得怎么办了~~~
请大侠支招 ~~·
你的gridview按钮是怎么放上去的
把前台的gridview代码给我
我能解决问题
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>
{
var tempnum=Math.random();
var ma = window.showModalDialog("EatEdit.aspx?id="+a+"&num="+tempnum,"","dialogWidth:700px;dialogHeight:400px");
window.location.href='EatFirst.aspx';
}