こんにちは、1 つの UserControl (GridPanel を含む) を tabPanel にロードしています。
しかし、Gridpanel Edit Command Button をクリックすると、サーバー側のイベント メソッドが機能せず、次のような例外が表示されます。
例外の詳細: System.Web.HttpException: ID 'id8b177c82adb2e925' のコントロールが見つかりません。
私のコードはここにあります
userControl の場合: .ascx コードは
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GridPanelUserControl.ascx.cs" Inherits="Ext_PracticeExamples.GridPanelUserControl" %>
<ext:GridPanel ID="gpEmployeeList" runat="server" StripeRows="true" Title="Employee List" Layout="FitLayout"
Width="620" Height="400" AutoExpandColumn="FirstName">
<Store>
.....
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:ImageCommandColumn ID="imgSettings" runat="server" Text="Settings" Resizable="false">
<Commands>
<ext:ImageCommand Icon="BasketEdit" Style="text-align: center" CommandName="Settings">
</ext:ImageCommand>
</Commands>
<Listeners>
<Command Handler=" #{DirectMethods}.fnDisplaySettings(record.data.Company,record.data.Price,record.data.Change);" />
</Listeners>
</ext:ImageCommandColumn>
</Columns>
</ColumnModel>
および起動していない対応する.csクラスファイルメソッド。
[DirectMethod]
public void fnDisplaySettings(string name, double X, double Y)
{
// ..some Operation....
Response.Redirect("~/_Default.aspx");
}
webBrowser でソース ページを観察しているときに、コントロールの ID が異なるため、対応する関数が表示されないことがわかりました。UserControl を使用せずに単一ページでこのコードを使用すると、正常に動作します。
サーバー側のメソッドを呼び出します。
ありがとうございました