这是我的代码:
var result = myDbContext.T1s.GroupBy(item => new {item.Country, item.city})
.Select(group => new
{
Country = group.Key.Country,
City = group.Key.City,
NumberOfSchools = group.SelectMany(groupElement => groupElement.Schools)
.Count(),
NumberOfColleges = group.SelectMany(groupElement => groupElement.Colleges)
.Count(),
})
代码背后
<asp:Button ID="btnViewSalesOfficer" CssClass="btn btn-sm btn-primary" data-target="#ViewSalesOfficerModal" data-toggle="modal" runat="server" Text="View" OnClick="btnViewSalesOfficer_Click" />
<div class="modal modal-wide in" id="ViewSalesOfficerModal" tabindex="-1" role="dialog" aria-labelledby="AVEModal" aria-hidden="false">
<div class="modal-dialog modal-lg">
<div id="ViewModalContent">
<section class="content">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">
<asp:Label ID="lblHeadingSalesOfficerName" runat="server" Text=""></asp:Label></h3>
</div>
<div class="panel-body">
<div class="row">
<div class="col-md-3 col-lg-3 " style="align-content:center">
<img src="../../Img/avatar.png" class="img img-circle" style="width:150px;height:150px;">
</div>
<div class=" col-md-9 col-lg-9 ">
<asp:Table ID="tbSaleOfficerInfo" CssClass="table table-user-information" runat="server">
<asp:TableRow>
<asp:TableCell CssClass="bold">First Name</asp:TableCell>
<asp:TableCell ID="tbCFirstName"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell CssClass="bold">Last Name</asp:TableCell>
<asp:TableCell ID="tbCLastName"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell CssClass="bold">Username</asp:TableCell>
<asp:TableCell ID="tbCUsername"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell CssClass="bold">Gender</asp:TableCell>
<asp:TableCell ID="tbCGender"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell CssClass="bold">Date Of Birth</asp:TableCell>
<asp:TableCell ID="tbCDOB"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell CssClass="bold">Date Of Joining</asp:TableCell>
<asp:TableCell ID="tbCDOJ"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell CssClass="bold">Address</asp:TableCell>
<asp:TableCell ID="tbCAddress"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell CssClass="bold">Email</asp:TableCell>
<asp:TableCell ID="tbCEmail"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell CssClass="bold">Phone</asp:TableCell>
<asp:TableCell ID="tbCPhone"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell CssClass="bold">Qualification</asp:TableCell>
<asp:TableCell ID="tbCQualification"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell CssClass="bold">Designation</asp:TableCell>
<asp:TableCell ID="tbCDesignation"></asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell CssClass="bold">Salary</asp:TableCell>
<asp:TableCell ID="tbCSalary"></asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</div>
</div>
<div class="panel-footer text-right">
<asp:Button ID="btnCloseModalPropView" CssClass="btn btn-sm btn-default" data-dismiss="modal" runat="server" Text="Close" />
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</div>
解释 上面的代码工作正常,触发弹出窗口,它出现在屏幕上,但服务器端代码没有执行,因此值将无法检索并显示在弹出模式中,因为onClick事件没有触发另一方面如果onClick事件触发然后popud由于回发而未出现