0

.ascx コントロールがあります。それは少数の Html テーブルと Div セクションを持っています Runat = "Server"

コードは次のようになります。

<div id = "divpayinfo" runat = "server">

<%!-- Some Code Here --%>

 <table style="width: 403px" runat = "server">
            <tr>
                <td style="width: 63px; height: 22px;">
                    test</td>
                <td colspan="2" style="height: 22px">
                    <strong><span style="color: #ffffff">ผู้ขอกู้หลัก</span></strong></td>
            </tr>
            <tr>
                <td style="width: 63px; height: 21px">
                </td>
                <td style="width: 180px; height: 21px">
                    <strong>วงเงิน&lt;/strong></td>
                <td style="height: 21px">
                    <strong>ยอดคงค้าง&lt;/strong></td>
            </tr>
            <tr>
                <td style="width: 63px">
                    1. เงินกู้เพื่อที่อยู่อาศัย</td>
                <td style="width: 180px">
                    <asp:TextBox ID="b_txt_lh_loan_h_all" runat="server" CssClass="box_nosize_right"
                        MaxLength="8" onchange="To_Set_Value(document.getElementById('d_txt_lh_loan_h_all'),document.getElementById('b_txt_lh_loan_h_all'))"
                        onfocus="To_Get_Value(document.getElementById('d_txt_lh_loan_h_all'),document.getElementById('b_txt_lh_loan_h_all'))"
                        onmouseout="To_Set_Value(document.getElementById('d_txt_lh_loan_h_all'),document.getElementById('b_txt_lh_loan_h_all'))"
                        Text="0" Width="90px"></asp:TextBox><asp:TextBox ID="d_txt_lh_loan_h_all" runat="server"
                            Text="0"></asp:TextBox></td>
                <td>
                    <asp:TextBox ID="b_txt_lh_loan_h_remain" runat="server" CssClass="box_nosize_right"
                        MaxLength="8" onchange="To_Set_Value(document.getElementById('d_txt_lh_loan_h_remain'),document.getElementById('b_txt_lh_loan_h_remain'))"
                        onfocus="To_Get_Value(document.getElementById('d_txt_lh_loan_h_remain'),document.getElementById('b_txt_lh_loan_h_remain'))"
                        onmouseout="To_Set_Value(document.getElementById('d_txt_lh_loan_h_remain'),document.getElementById('b_txt_lh_loan_h_remain'))"
                        Text="0" Width="90px"></asp:TextBox><asp:TextBox ID="d_txt_lh_loan_h_remain" runat="server"
                            Text="0"></asp:TextBox></td>
            </tr>
            <tr>
                <td style="width: 63px; height: 102px;">
                    2. เงินกู้เบิกเกินบัญชี</td>
                <td style="width: 180px; height: 102px;">
                    <asp:TextBox ID="b_txt_lh_loan_a_all" runat="server" CssClass="box_nosize_right"
                        MaxLength="8" onchange="To_Set_Value(document.getElementById('d_txt_lh_loan_a_all'),document.getElementById('b_txt_lh_loan_a_all'))"
                        onfocus="To_Get_Value(document.getElementById('d_txt_lh_loan_a_all'),document.getElementById('b_txt_lh_loan_a_all'))"
                        onmouseout="To_Set_Value(document.getElementById('d_txt_lh_loan_a_all'),document.getElementById('b_txt_lh_loan_a_all'))"
                        Text="0" Width="90px"></asp:TextBox><asp:TextBox ID="d_txt_lh_loan_a_all" runat="server"
                            Text="0"></asp:TextBox></td>
                <td style="height: 102px">
                    <asp:TextBox ID="b_txt_lh_loan_a_remain" runat="server" CssClass="box_nosize_right"
                        MaxLength="8" onchange="To_Set_Value(document.getElementById('d_txt_lh_loan_a_remain'),document.getElementById('b_txt_lh_loan_a_remain'))"
                        onfocus="To_Get_Value(document.getElementById('d_txt_lh_loan_a_remain'),document.getElementById('b_txt_lh_loan_a_remain'))"
                        onmouseout="To_Set_Value(document.getElementById('d_txt_lh_loan_a_remain'),document.getElementById('b_txt_lh_loan_a_remain'))"
                        Text="0" Width="90px"></asp:TextBox><asp:TextBox ID="d_txt_lh_loan_a_remain" runat="server"
                            Text="0"></asp:TextBox></td>
            </tr>
        </table>

サーバー側でDIVとHTMLテーブルを操作しています。サーバー側として言及したように。このコントロールを formusercontrolwebpart として SharePoint にアップロードします。

問題は、runat="Server" タグを使用してテーブルをアップロードすると、ユーザー コントロールが sharepoint ページに表示されないことです...このテーブルをコピーして、このテーブルのみで別の ascx を作成し、sharepoint にアップロードしますが、これは機能しています大丈夫。

すべてのユーザー コントロール コードを確認し、ASP.NET アプリケーションを追加しました。ユーザーコントロールは期待どおりに機能しており、問題はありません。しかし、Sharepointページを追加した場合にのみ、問題が発生しています..

私は次の解決策を見つけました、

すべての Div セクションからすべての runat = "server" タグを削除し、runat ="server" をテーブルに追加すると、sharepoint ページが機能します。しかし、私の問題は、サーバー側でDivタグを使用して多くの操作を行っていることです。そのため、このソリューションを使用できません..

専門家にアドバイスしてください..とにかく、runat = "server"タグをユーザーコントロールまたはそれに関連するものから保護する共有ポイントがあります...事前に感謝します..

次のコード行を追加すると、ユーザー コントロールの表示がレンダリングされません。

<asp:TableCell id="d_div_l2_row9" runat="server" style="display: none; vertical-align: middle;
                    text-align: center">
                    <asp:TextBox ID="b_txt_l2_comission" runat="server" CssClass="box_nosize_right" MaxLength="8"
                        onchange="To_Set_Value(document.getElementById('d_txt_l2_comission'),document.getElementById('b_txt_l2_comission'))"
                        onfocus="To_Get_Value(document.getElementById('d_txt_l2_comission'),document.getElementById('b_txt_l2_comission'))"
                        onmouseout="To_Set_Value(document.getElementById('d_txt_l2_comission'),document.getElementById('b_txt_l2_comission'))"
                        Text="0" Width="180px"></asp:TextBox><span style="display: none"><asp:TextBox ID="d_txt_l2_comission"
                            runat="server" Text="0"></asp:TextBox></span></asp:TableCell>
4

3 に答える 3

0
<asp:TableCell id="d_div_l2_row9" runat="server" style="**display: none;** vertical-align: middle;
                    text-align: center">
                    <asp:TextBox ID="b_txt_l2_comission" runat="server" CssClass="box_nosize_right" MaxLength="8"
                        onchange="To_Set_Value(document.getElementById('d_txt_l2_comission'),document.getElementById('b_txt_l2_comission'))"
                        onfocus="To_Get_Value(document.getElementById('d_txt_l2_comission'),document.getElementById('b_txt_l2_comission'))"
                        onmouseout="To_Set_Value(document.getElementById('d_txt_l2_comission'),document.getElementById('b_txt_l2_comission'))"
                        Text="0" Width="180px"></asp:TextBox><span style="display: none"><asp:TextBox ID="d_txt_l2_comission"
                            runat="server" Text="0"></asp:TextBox></span></asp:TableCell>

テキスト表示:スタイルのどれも、これはあなたが生成または追加したものではありません。これは、コントロールが表示されるべきではないことを意味します。

于 2013-02-11T20:42:39.943 に答える
0

asp:panel は、基になる HTML で div に変換されると思います。あなたはそれを試すことができます。

<asp:panel id="divpayinfo" runat="server">

  <!-- Your code here -->

</asp:panel>
于 2013-02-11T08:26:20.557 に答える