开发环境:vs2003
要求:有2个页面,A和B,A页面有翻页功能,A页面有datagrid展示的数据,数据有序号,姓名,费用,3个字段,
我在姓名上创建了一个超链接,点击后链接到B页面显示该人的详细信息,
那么链接时,我也需要把序号也作为参数传递过去。这个序号是在后台生成 的,
现在要在前台拿,怎么拿?
后台序号生成是这样的,我用了模板列,标签绑定这个序号:
Label lbl = (Label)e.Item.FindControl("lbl_id");
if(e.Item.ItemIndex != -1 )
{
//取得当前项的索引值加1,因为项的索引值是从0开始的.
int orderID = e.Item.ItemIndex+1;
//设置第一列为的单元格内容为当前项索引值加1
lbl.Text=orderID.ToString();
}<a target=_blank href='MeetingInfo2.aspx?Id=<%# DataBinder.Eval( Container.DataItem, "m_id" ) %>
&type=1&m_no=???</a>
请问打???处怎么获取模板列中的label值啊
要求:有2个页面,A和B,A页面有翻页功能,A页面有datagrid展示的数据,数据有序号,姓名,费用,3个字段,
我在姓名上创建了一个超链接,点击后链接到B页面显示该人的详细信息,
那么链接时,我也需要把序号也作为参数传递过去。这个序号是在后台生成 的,
现在要在前台拿,怎么拿?
后台序号生成是这样的,我用了模板列,标签绑定这个序号:
Label lbl = (Label)e.Item.FindControl("lbl_id");
if(e.Item.ItemIndex != -1 )
{
//取得当前项的索引值加1,因为项的索引值是从0开始的.
int orderID = e.Item.ItemIndex+1;
//设置第一列为的单元格内容为当前项索引值加1
lbl.Text=orderID.ToString();
}<a target=_blank href='MeetingInfo2.aspx?Id=<%# DataBinder.Eval( Container.DataItem, "m_id" ) %>
&type=1&m_no=???</a>
请问打???处怎么获取模板列中的label值啊
&type=1&m_no=<%# ((Label)((DataGridItem)Container.DataItem).FindControl("lbl_id")).Text %> </a>
汗,没写完整<a target="_blank" href='MeetingInfo2.aspx?Id= <%# DataBinder.Eval( Container.DataItem, "m_id" ) %>
&type=1&m_no=<%# ((Label)((DataGridItem)Container.DataItem).FindControl("lbl_id")).Text %>'>链接的文字 </a>
<%# Show(DataBinder.Eval( Container.DataItem, "m_name" ).ToString()) %>
</a>
<%# Show(DataBinder.Eval( Container.DataItem, "m_name" ).ToString()) %>
</a>
<ItemTemplate>
<%# Container.ItemIndex+1 %>
</ItemTemplate>
</asp:TemplateColumn>
分页累加序号:
<asp:TemplateColumn HeaderText="序号">
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
<ItemTemplate>
<%# (DataGrid1.PageSize * DataGrid1.CurrentPageIndex) + Container.ItemIndex +1 %>
</ItemTemplate>
</asp:TemplateColumn>