img怎么传递参数
img如何传递参数
有一个datagridview,其中有一列是编辑,当我点击某一行的编辑图片时,要求把改行的第一列,也就是Tt_TeamNo那一列的团号给传递到OpenAddDialog中,通过 window.showModalDialog把这个编号传递到新窗口,请问我该怎么改下面的代码啊?麻烦说详细点儿,我是新手~~~帮我把标红的两段代码改正一下
function OpenAddDialog()
{
window.showModalDialog("OrderCarManager.aspx", ""
,"center=yes;edge=raised;status=yes;dialogHeight=420px;dialogWidth=640px");
}
*************************************************************************************************
<asp:GridView ID="GridView1" runat="server" Height="134px"
Width="743px" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False" OnRowCreated="GridView1_RowCreated" SkinID="show" DataKeyNames="Tt_TeamNo">
<Columns>
<asp:BoundField DataField="Tt_TeamNo" HeaderText="团号" SortExpression="Tt_TeamNo" />
<asp:TemplateField HeaderText="订车">
<ItemTemplate>
<img onclick="OpenAddDialog()" alt =''id="ImageButton1" style=" cursor :hand;" src="../../Images/edit.jpg" />
<asp:CheckBox ID="CheckBox1" runat="server" Checked="false" Enabled="false"/>
</ItemTemplate>
</asp:TemplateField>
------解决思路----------------------
<img onclick="OpenAddDialog()" 这里,改为: <img onclick="OpenAddDialog(this)"
然后,接收的时候,
function OpenAddDialog(obj)
{
window.showModalDialog("OrderCarManager.aspx?="+obj.id, ""
,"center=yes;edge=raised;status=yes;dialogHeight=420px;dialogWidth=640px");
}
------解决思路----------------------
说了估计你的主键是string类型的,string类型在OpenAddDialog这个方法里要单引号或者双引号包含下……
叫你贴html你也不贴,不是vs里的代码,是浏览器里面通过源文件查看到的代码
有一个datagridview,其中有一列是编辑,当我点击某一行的编辑图片时,要求把改行的第一列,也就是Tt_TeamNo那一列的团号给传递到OpenAddDialog中,通过 window.showModalDialog把这个编号传递到新窗口,请问我该怎么改下面的代码啊?麻烦说详细点儿,我是新手~~~帮我把标红的两段代码改正一下
function OpenAddDialog()
{
window.showModalDialog("OrderCarManager.aspx", ""
,"center=yes;edge=raised;status=yes;dialogHeight=420px;dialogWidth=640px");
}
*************************************************************************************************
<asp:GridView ID="GridView1" runat="server" Height="134px"
Width="743px" DataSourceID="ObjectDataSource1" AutoGenerateColumns="False" OnRowCreated="GridView1_RowCreated" SkinID="show" DataKeyNames="Tt_TeamNo">
<Columns>
<asp:BoundField DataField="Tt_TeamNo" HeaderText="团号" SortExpression="Tt_TeamNo" />
<asp:TemplateField HeaderText="订车">
<ItemTemplate>
<img onclick="OpenAddDialog()" alt =''id="ImageButton1" style=" cursor :hand;" src="../../Images/edit.jpg" />
<asp:CheckBox ID="CheckBox1" runat="server" Checked="false" Enabled="false"/>
</ItemTemplate>
</asp:TemplateField>
------解决思路----------------------
<img onclick="OpenAddDialog()" 这里,改为: <img onclick="OpenAddDialog(this)"
然后,接收的时候,
function OpenAddDialog(obj)
{
window.showModalDialog("OrderCarManager.aspx?="+obj.id, ""
,"center=yes;edge=raised;status=yes;dialogHeight=420px;dialogWidth=640px");
}
------解决思路----------------------
说了估计你的主键是string类型的,string类型在OpenAddDialog这个方法里要单引号或者双引号包含下……
叫你贴html你也不贴,不是vs里的代码,是浏览器里面通过源文件查看到的代码