.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>วงเงิน</strong></td>
<td style="height: 21px">
<strong>ยอดคงค้าง</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>