Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/65.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当添加Runat=";服务器";标记到HTML表,sharepoint不显示usercontrol_Sharepoint_Sharepoint 2010_Sharepoint 2007_Sharepoint Designer - Fatal编程技术网

当添加Runat=";服务器";标记到HTML表,sharepoint不显示usercontrol

当添加Runat=";服务器";标记到HTML表,sharepoint不显示usercontrol,sharepoint,sharepoint-2010,sharepoint-2007,sharepoint-designer,Sharepoint,Sharepoint 2010,Sharepoint 2007,Sharepoint Designer,我有一个.ascx控件。这意味着几乎没有Html表和Div节Runat=“Server” 代码如下所示: <div id = "divpayinfo" runat = "server"> <%!-- Some Code Here --%> <table style="width: 403px" runat = "server"> <tr> <td style="width: 63p

我有一个.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>

测试
ผู้ขอกู้หลัก
วงเงิน
ยอดคงค้าง
1.เงินกู้เพื่อที่อยู่อาศัย
2.เงินกู้เบิกเกินบัญชี

我正在服务器端使用DIV和HTML表进行一些操作。所以我提到了服务器端。我将此控件作为formusercontrolwebpart上载到Sharepoint

问题是当我上载带有runat=“Server”标记的表时,usercontrol没有显示在sharepoint页面上。。。因此,我复制此表,并仅使用此表创建另一个ascx,然后将其上载到sharepoint,但这一切正常

我已经检查了所有的用户控制代码,并添加了ASP.NET应用程序。usercontrol按预期工作,没有问题。但只有当我添加Sharepoint页面时,它才会出现问题

我找到了以下解决方案

从每个Div部分删除所有runat=“server”标记,并将runat=“server”添加到表中,然后sharepoint页面开始工作。但我的问题是,我在服务器端有很多使用Div标记的操作,所以我不能使用这个解决方案

请向我推荐专家。。是否存在sharepoint保护usercontrol或任何与此相关的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>

我认为asp:panel会转换为底层HTML中的div。你可以试试看

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

  <!-- Your code here -->

</asp:panel>



文本显示:样式中没有由您生成或添加的内容。因为这意味着不应显示控件。

驼鹿、安德鲁和香蕉

非常感谢你努力帮助我

我找到了另一种解决办法,但要找出原因对我来说仍然很头疼


我在sharepoint server“control template”文件夹中上载了相同的usercontrol,并且为该用户控件创建了一个.aspx页面,并在sharepoint中上载了该aspx。现在它与asp.net应用程序的工作方式一样正常。

谢谢亲爱的Moose,现在我正在将所有Div部分转换为Panel,将所有HTML表转换为asp:table。。但我的问题是有很多Div和Table:)大概有8个表和25个Div部分。。这就是我试图找出核心问题的原因。。如果您有任何建议,请分享sharepoint中是否存在阻止我的Div和表不能一起工作的任何安全相关问题:(我已将我的所有Div和表转换为ASP.NET面板和ASP:Table,但仍然面临相同的问题..如果我删除runat=“server”,我会在某个时候从oneline中发现标记,然后我可以查看用户控件…我不确定此错误的原因:(对不起,我没有很多其他想法。你能查看源代码,然后看看div和tables是否存在吗?也许有一些Javascript正在调整visible属性或类似的东西?Moose先生,我注释掉了所有的js。尽管仍然是同一个问题。非常感谢你的注释。我不确定我是否理解你的问题。)显然,任何带有
runat=“server”
的标记都会导致用户控件消失?亲爱的香蕉,runat=“server”标记在某一行之前工作正常。但是当我在特定行之后插入runat sever时,usercontrol没有显示。我已彻底检查了代码。我的usercontrol在我的asp.net Web应用程序中工作正常。但它在sharepoint页面中不工作。您是否尝试调试并查看是否存在异常?我已经找到了一些解决方法r这个问题..仍然无法找到确切的问题亲爱的Andrew,是的,这对UI是不可见的,我不使用这个文本框进行任何操作…即使我使用runat=server标记(如Testcall)添加另一个控件来代替这个文本框..然后也不显示..我也对javascript和我的Business&DB层进行了注释..不走运..s直到对sharepoint感到困惑。我在asp.net应用程序中添加了usercontrol。它工作正常,但sharepoint页面只会给我带来问题。请将此标记为已接受,以便将此问题标记为已解决,并且不会在列表中显示为打开状态。
<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>