gridview を Linq の結果にバインドし、AutoGenerateColumns を true に設定し、グリッド ビューの Enabled Viewstate を設定しましたが、まだまったくレンダリングされていません。ブラウザの Html は空を示しています
<div></div>
奇妙なのは、ファイル システムの ASP.NET 開発サーバーでは問題なく表示されますが、インターネットでホストしたときはそうではありません!!
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:asyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
<ContentTemplate >
<asp:GridView dir="rtl" ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" CellPadding="4" AutoGenerateColumns="true"
ForeColor="#333333" GridLines="Vertical" ViewStateMode="Enabled"
Width="917px" style=" padding-bottom:20px;" EnableViewState="True">
<AlternatingRowStyle BackColor="White" />
<EditRowStyle BackColor="#2461BF" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White"
HorizontalAlign="Right" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="#EFF3FB" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<SortedAscendingCellStyle BackColor="#F5F7FB" />
<SortedAscendingHeaderStyle BackColor="#6D95E1" />
<SortedDescendingCellStyle BackColor="#E9EBEF" />
<SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
<br />
<br />
</ContentTemplate>
</asp:UpdatePanel>
ちなみにAjaxコントロールも外してみましたが解決しませんでした
Linq コードはかなり複雑ですが、これをお見せできます
tmp = (From p In results Where p.ShowProduct
Select New With {.المادة = p.ProductName,
.السعر = If(p.Setting.ShowPrices, If(p.ShowPrice, (p.SellPrice * p.Setting.ConversionToDollar).ToString, " - "), " - "),
.الكمية = If(p.Setting.ShowCounts, If(p.ShowCount, CSng(p.Count) & " " & p.Unit, " - "), " - "),
.الصنف = p.Category,
.الوصف = p.Description,
.المنشأ = p.Manufacturer,
.المحل = If(p.Setting.ShowAddress,
If(p.Setting.ShowMobile,
p.Setting.NameOfShop & "/" & p.Setting.ShopAddress & "/" & p.Setting.Mobile,
p.Setting.NameOfShop & "/" & p.Setting.ShopAddress & "/ -"),
If(p.Setting.ShowMobile,
p.Setting.NameOfShop & "/ - /" & p.Setting.Mobile,
p.Setting.NameOfShop & "/ - / - ")),
.التاريخ = p.LastUpdate}).ToList.OrderByDescending(Function(n) n.GetType().GetProperty(GridViewSortExpression).GetValue(n, Nothing)).ToList
End If
ResultCount = results.Count
GridView1.DataSource = tmp
' GridView1.ViewStateMode = UI.ViewStateMode.Enabled
GridView1.DataBind()
私もこのコード行を入れようとしました
UpdatePanel1.Update()
私を助けてください