findcontrol

    0熱度

    1回答

    我在頁面上嵌套了GridView(默認),我需要獲取GridView的ID,但它返回null。我有一個嵌套的GridViews之外的UpdatePanel。它使用一個母版頁。 GridView gv = (GridView)UpdatePanel1.FindControl("GridViewSchedule");

    1熱度

    2回答

    母版頁中我得到了我想要控制從母版頁的代碼背後給它添加如下面板: var cphRegionName = this.Page.FindControl("pnlLeft") as Panel; cphRegionName.Controls.Add(uc); 但我得到這個錯誤: Object reference not set to an instance of an object at cphR

    0熱度

    1回答

    我想通過在前一頁上查找控件(文本框)將文本分配給標籤。 該控件已準確找到,但文本無法分配。智能感知不顯示「文本」屬性。如何獲得文本? protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Control ctContent = this.PreviousPa

    0熱度

    1回答

    我在usercontrol中定義了一個字面值,它嵌入在aspx中,本身嵌入在Masterpage中。 this.Parent.FindControl(「litError」)向我返回控件...但客戶端ID是「phContent_litError」。它發現在服務器端代碼控制... 當我看着生成的HTML,我看「ctl00_ctl00_phContent_litErrorPanel」 它是正常的嗎? 我

    0熱度

    1回答

    我在我的ASPX頁面上動態添加了一些控件。我需要動態添加它們,因爲控件數量取決於數據庫記錄。 我使用UpdatePanel和動態添加控件這樣的: void AddFileUploadFields() { for (int i = 0; i < Helper.uploadFieldsCount; i++) { FileUpload fileUpload = new

    2熱度

    1回答

    我使用一個GridView控件,這裏是我的模板列之一: <asp:TemplateField HeaderText="Quantity" SortExpression="Quantity"> <HeaderTemplate> <asp:Label ToolTip="Quantity" runat="server" Text="Qty"></asp:Label> </

    0熱度

    2回答

    我需要一個建議如何糾正我的代碼。我正在使用FindControl方法在Repeater中查找TextBox。這是我的標記: <asp:Repeater ID="Repeater1"> HERE ARE SOME OTHER DATA <ItemTemplate> <asp:FormView ID="FormViewAddComment" runat="server"

    0熱度

    2回答

    使用此ASP.Net LoginView用戶名文本框領域,我們想將焦點設置時,它加載的網頁上的用戶名文本框: <asp:LoginView ID="loginViewMain" runat="server"> <LoggedInTemplate> <asp:LoginName ID="loginName" runat="ser

    1熱度

    1回答

    我在插入數據插入數據到數據庫時遇到了問題。 <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1" OnItemDataBound="Repeater1_ItemDataBound"> <ItemTemplate> <!-- Some other data (text...) -->

    0熱度

    1回答

    我想從同一列中的文本框求和(添加)值,並分別顯示SUM到最後一行文本框,點擊「計算」按鈕 所有的文本框都是通過點擊「創建表」按鈕動態生成的。 我沒有得到如何獲得這些文本框的ID。 .aspx文件的代碼如下: <asp:Label ID="lblTest" runat="server"></asp:Label>  <asp:Label ID="Label1" runat="ser