我有我在我的ASP.NET Web應用程序頁面中的一個問題 - computers.aspx頁面。選擇GridView控件不觸發 - ASP.NET
當點擊任何的「GridView1」記錄的選擇按鈕 - 選擇不火。我瀏覽了大約20個相關的問題,但找不到任何有用的東西。
見下面的代碼:
<div class="table-responsive" style="border:none">
<asp:GridView ID="GridView1" CssClass="table" runat="server" AllowPaging="True" GridLines="None" OnSelectedIndexChanged="OnSelectedIndexChanged" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="idComputers" DataSourceID="ComputersGridview">
<Columns>
<asp:Templatefield ShowHeader="false">
<ItemTemplate>
<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="true" OnClick="LinkButton1_Click" commandname="select" Text="<span class="glyphicon glyphicon-info-sign" style="font-size:x-large;font-align:center;color:rgb(34,54,104);" />"></asp:LinkButton>
</ItemTemplate>
</asp:Templatefield><asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="true" CommandName="Select" Text="<span class="glyphicon glyphicon-check" style="font-size:x-large;font-align:center;color:rgb(34,54,104);" />"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Status" HeaderText="Status" SortExpression="Status" />
<asp:BoundField DataField="Hostname" HeaderText="Hostname" SortExpression="Hostname" />
<asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username" />
<asp:BoundField DataField="officename" HeaderText="Office Name" SortExpression="officename" />
<asp:BoundField DataField="IPAddress" HeaderText="IP Address" SortExpression="IPAddress" />
<asp:BoundField DataField="ManufacturerName" HeaderText="Manufacturer" SortExpression="ManufacturerName" />
<asp:BoundField DataField="Model" HeaderText="Model" SortExpression="Model" />
<asp:BoundField DataField="HDDSize" HeaderText="HDD Size" SortExpression="HDDSize" />
<asp:BoundField DataField="RAMSize" HeaderText="RAM Size" SortExpression="RAMSize" />
</Columns>
<RowStyle HorizontalAlign="Center" />
</asp:GridView>
<asp:SqlDataSource ID="ComputersGridView" runat="server" ConnectionString="<%$ ConnectionStrings:ITManagementConnectionString %>" ProviderName="<%$ ConnectionStrings:ITManagementConnectionString.ProviderName %>" SelectCommand="SELECT computers.idComputers, status.Status, computers.Hostname, ingenium.person.id, ingenium.person.forename, ingenium.person.surname, CASE WHEN ingenium.person.knownas = ' ' THEN concat(ingenium.person.forename, ' ', ingenium.person.surname) ELSE ingenium.person.knownas end AS Username, office.officename, computers.IPAddress, manufacturer.ManufacturerName, model.Model, harddrive.HDDSize, ram.RAMSize, Computers.DateCreated FROM computers INNER JOIN ingenium.person ON computers.idUser = ingenium.person.id INNER JOIN status ON computers.idStatus = status.idStatus INNER JOIN office ON computers.idoffice = office.idoffice INNER JOIN manufacturer ON computers.idManufacturer = manufacturer.idManufacturer INNER JOIN model ON computers.idModel = model.idModel INNER JOIN harddrive ON computers.idHDD = harddrive.idHardDrive INNER JOIN ram ON computers.idRAM = ram.idRAM WHERE (computers.idComputerType = 1) OR (computers.idComputerType = 2) ORDER BY computers.datecreated DESC">
</asp:SqlDataSource>
</div>
這是昨天的工作 - 選擇卻突然停止了射擊。
任何幫助將不勝感激!
非常感謝,
克里斯
最近是否添加一個UpdatePanel? –
不,我不使用他們 –
檢查你的開發人員工具控制檯 – InferOn