首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

.net 一个嵌套有关问题

2011-12-20 
.net 一个嵌套问题%@ImportNamespace System.Data %%@Pagelanguage c# Codebehind PbAdd.aspx.

.net 一个嵌套问题
<%@   Import   Namespace= "System.Data "   %>
<%@   Page   language= "c# "   Codebehind= "PbAdd.aspx.cs "   AutoEventWireup= "false "   Inherits= "CrownRealty.PoliceFire.PbAdd "   %>
<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.0   Transitional//EN "   >
<HTML>
<HEAD>
<title> PbAdd </title>
<meta   name= "GENERATOR "   Content= "Microsoft   Visual   Studio   .NET   7.1 ">
<meta   name= "CODE_LANGUAGE "   Content= "C# ">
<meta   name= "vs_defaultClientScript "   content= "JavaScript ">
<meta   name= "vs_targetSchema "   content= "http://schemas.microsoft.com/intellisense/ie5 ">
<LINK   href= "../css/default.css "   type= "text/css "   rel= "stylesheet ">
</HEAD>
<body>
<form   id= "Form1 "   method= "post "   runat= "server ">
<table   class= "page_place "   cellSpacing= "0 "   cellPadding= "0 "   width= "100% "   border= "0 ">
<tr>
<td   vAlign= "middle "   align= "center "   width= "32 "   height= "24 "> <IMG   height= "16 "   src= "../images/page/page_place.gif "   width= "16 "> </td>
<td> &nbsp;&nbsp;当前位置:治安消防   &gt; <asp:label   id= "lblPositionName "   runat= "server "> 岗位排班 </asp:label> &nbsp;&gt;排班信息浏览 </td>
</tr>
</table>
<br>
<table   height= "0 "   cellSpacing= "0 "   cellPadding= "0 "   width= "95% "   align= "center "   border= "0 ">
<tr>
<td> <a   href= 'PbAdd.aspx?ID= <%=Request.QueryString[ "ID "].ToString().Trim()%> '> 岗位排班 </a>
</td>
</tr>
</table>
<br>
<table   cellSpacing= "0 "   cellPadding= "0 "   width= "95% "   align= "center "   border= "0 ">
<tr>
<td> <TABLE   id= "Table3 "   cellSpacing= "0 "   cellPadding= "0 "   width= "100% "   border= "0 ">
<TR>
<TD   width= "20 "   height= "25 "> <IMG   height= "25 "   src= "../images/page/table_tit_l.gif "   width= "20 "> </TD>
<TD   class= "title1 "   noWrap> <a   href= 'PbUserShow.aspx?ID= <%=Request.QueryString[ "ID "].ToString().Trim()%> '> 按人员查询 </a> </TD>
<TD   width= "10 "> <IMG   height= "25 "   src= "../images/page/table_tit_r.gif "   width= "10 "> </TD>
<TD   width= "20 "   height= "25 "> <IMG   height= "25 "   src= "../images/page/table_tit_l.gif "   width= "20 "> </TD>
<TD   class= "title1 "   noWrap> <a   href= 'PbShow.aspx?ID= <%=Request.QueryString[ "ID "].ToString().Trim()%> '> 按日期查询 </a> </TD>


<TD   width= "10 "> <IMG   height= "25 "   src= "../images/page/table_tit_r.gif "   width= "10 "> </TD>
<TD   width= "20 "   height= "25 "> <IMG   height= "25 "   src= "../images/page/table_tit_l.gif "   width= "20 "> </TD>
<TD   class= "title1 "   noWrap> <a   href= 'PbGwShow.aspx?ID= <%=Request.QueryString[ "ID "].ToString().Trim()%> '> 按岗位查询 </a> </TD>
<TD   width= "10 "> <IMG   height= "25 "   src= "../images/page/table_tit_r.gif "   width= "10 "> </TD>
<TD   class= "tdimages "   align= "right "   width= "99% "> </TD>
</TR>
</TABLE>
<TABLE   class= "tableclass1 "   id= "Table4 "   cellSpacing= "0 "   cellPadding= "0 "   width= "100% "   border= "0 ">
<TR>
<TD   class= "table_top "> </TD>
</TR>
<TR>
<TD> <table   class= "tableclass "   id= "Table1 "   cellSpacing= "0 "   cellPadding= "3 "   width= "100% "   align= "center ">
<tr>
<td> <asp:DataGrid   id= "DataGrid1 "   runat= "server "   Width= "100% "   BorderStyle= "None "   BorderColor= "#CCCCCC "
BorderWidth= "1px "   BackColor= "White "   CellPadding= "3 "   AutoGenerateColumns= "False ">
<SelectedItemStyle   Font-Bold= "True "   ForeColor= "White "   BackColor= "#669999 "> </SelectedItemStyle>
<ItemStyle   ForeColor= "#000066 "> </ItemStyle>
<HeaderStyle   Font-Bold= "True "   ForeColor= "White "   BackColor= "#006699 "> </HeaderStyle>
<FooterStyle   ForeColor= "#000066 "   BackColor= "White "> </FooterStyle>
<Columns>
<asp:TemplateColumn>
<HeaderTemplate>
<FONT   face= "宋体 "> 选择 </FONT>
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox   id= "Checkbox1 "   runat= "server "> </asp:CheckBox>
</ItemTemplate>
</asp:TemplateColumn>
<asp:BoundColumn   DataField= "name "   HeaderText= "岗位 "> </asp:BoundColumn>
<asp:TemplateColumn   HeaderText= "包含班次 ">
<ItemTemplate>
<asp:DataGrid   id= "DataGrid2 "   runat= "server "   Width= "100% "   BorderStyle= "None "   BorderColor= "#CCCCCC "   BorderWidth= "1px "   BackColor= "White "   CellPadding= "3 "   AutoGenerateColumns= "False "   DataSource= ' <%#   ((DataRowView)Container.DataItem).Row.GetChildRows( "myrelation ")   %> '>
<SelectedItemStyle   Font-Bold= "True "   ForeColor= "White "   BackColor= "#669999 "> </SelectedItemStyle>


<ItemStyle   ForeColor= "#000066 "> </ItemStyle>
<HeaderStyle   Font-Bold= "True "   ForeColor= "White "   BackColor= "#006699 "> </HeaderStyle>
<FooterStyle   ForeColor= "#000066 "   BackColor= "White "> </FooterStyle>
<Columns>
<asp:BoundColumn   DataField= "bcname "   HeaderText= "班次 "> </asp:BoundColumn>
</Columns>
</asp:DataGrid>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
<PagerStyle   Visible= "False "   HorizontalAlign= "Left "   ForeColor= "#000066 "   BackColor= "White "   Mode= "NumericPages "> </PagerStyle>
</asp:DataGrid> </td>
</tr>
</table>
</TD>
</TR>
<TR>
<TD   class= "table_bot "> </TD>
</TR>
</TABLE>
</td>
</tr>
</table>
</form>
</body>
</HTML>

[解决办法]
ds.Relations.Add( "myrelation ",
ds.Tables[ "admin "].Columns[ "id "],
ds.Tables[ "sub_menu "].Columns[ "gwid "],false);
==================================================
DataRelation xxx = ds.Relations.Add( "myrelation ",
ds.Tables[ "admin "].Columns[ "id "],
ds.Tables[ "sub_menu "].Columns[ "gwid "]);


DataSource= ' <%# ((DataRowView)Container.DataItem).Row.GetChildRows( "myrelation ") %> '
==================================================================
DataSource= ' <%# ((DataRowView)Container.DataItem).Row.GetChildRows( "xxx ") %> '

热点排行