单击后ASP面板不显示

时间:2016-10-12 17:47:41

标签: c# asp.net ajax panel

所以,我有一个列表,每个人都应该在点击时显示并显示一个面板。但是我编写的最后一个模块只是刷新页面但没有做任何事情,没有显示面板,但所有其他模块都显示面板没有问题。

这是代码中的一小部分。

    <tr id="trShare">
                                    <td>
                                        <asp:Image ID="imgShare" runat="server" ImageUrl ="Images/share.png" width="22px" height="22px" />
                                    </td>
                                    <td align="left" valign="middle">
                                          <asp:LinkButton ID="lnkShare" runat="server" Text="Share..." ></asp:LinkButton> 
                                    </td>
                                </tr>

<tr id="trEmail">
                                <td>
                                    <asp:Image ID="Image1" runat="server" ImageUrl ="Images/share.png" width="22px" height="22px" />
                                </td>
                                <td align="left" valign="middle">
                                      <asp:LinkButton ID="lnkEmail" runat="server" Text="Email Contact" ></asp:LinkButton> 
                                </td>
                            </tr>
<asp:Panel ID="panelShare" runat="server" CssClass="modalPopUp">
        <h2>Share this applicant</h2>
        <hr />
        <blockquote>
            <p>An email will be sent with a link to this page.  Please add a valid username.  Only @asf.edu.mx are allowed.</p>
            <p> <asp:TextBox ID="txtShareWith" runat="server" Width="120px"></asp:TextBox>@asf.edu.mx </p>
            <br /><br /><br /><br />
            <div style="text-align:right;">
                <asp:Button  ID="btnCancelShare" runat="server" Text="Cancel" CausesValidation="false" />
                &nbsp;&nbsp;&nbsp;
                <asp:Button ID="btnShare" runat="server" Text="Share"  CausesValidation="false" OnClick="btnShare_Click" />
            </div>
        </blockquote>           
    </asp:Panel>
    <asp:Panel ID="panelEmail" runat="server" CssClass="modalPopUp">
        <h2>Share this applicant</h2>
        <hr />
        <blockquote>
            <p>An email will be sent with a link to this page.  Please add a valid username.  Only @asf.edu.mx are allowed.</p>
            <p> <asp:TextBox ID="TextBox1" runat="server" Width="120px"></asp:TextBox>@asf.edu.mx </p>
            <br /><br /><br /><br />
            <div style="text-align:right;">
                <asp:Button  ID="Button1" runat="server" Text="Cancel" CausesValidation="false" />
                &nbsp;&nbsp;&nbsp;
                <asp:Button ID="Button2" runat="server" Text="Share"  CausesValidation="false" />
            </div>
        </blockquote>           
    </asp:Panel>

    <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender4" runat="server"
        PopupControlID="panelEmail" 
        TargetControlID="lnkEmail"
        CancelControlID="btnCancelEmail"
        BackgroundCssClass="modalBackGround" 
        DropShadow="true" ></ajaxToolkit:ModalPopupExtender>

    <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
        PopupControlID="panelShare" 
        TargetControlID="lnkShare"
        CancelControlID="btnCancelShare"
        BackgroundCssClass="modalBackGround" 
        DropShadow="true" ></ajaxToolkit:ModalPopupExtender>

“电子邮件”部分根本没有显示....

1 个答案:

答案 0 :(得分:1)

我想我发现了这个问题。面板import java.util.*; class HashMethod { public void foo() { System.out.println("foo"); } public void bar() { System.out.println("bar"); } public static void main(String[] args) throws IllegalAccessException { HashMethod obj = new HashMethod(); Map<Character, java.lang.reflect.Method> methods = new HashMap<Character, java.lang.reflect.Method>(); try { Character val = 'a'; java.lang.reflect.Method method = obj.getClass().getMethod("foo"); methods.put(val, method); Character val2 = 'b'; java.lang.reflect.Method method2 = obj.getClass().getMethod("bar"); methods.put(val2, method2); } catch (SecurityException e) { System.out.print("exc1" + e.toString()); } catch (NoSuchMethodException e) { System.out.print("exc2" + e.toString()); } Scanner s = new Scanner(System.in); Character val = s.next().charAt(0); try { java.lang.reflect.Method methodToRun = ((java.lang.reflect.Method) methods.get(val)); methodToRun.invoke(obj, null); } catch (Exception e) { System.out.print("invalid input"); } } } 中不存在按钮btnCancelEmail

更改

panelEmail

<asp:Button  ID="Button1" runat="server" Text="Cancel" CausesValidation="false" />