簡體   English   中英

如何在Java腳本彈出窗口中顯示表格格式的數據

[英]how to display table formatted data in java script popup

嗨,如何在Java腳本彈出窗口中顯示表格格式的數據。 可以在Java腳本彈出窗口中顯示表格式的數據。 使用C#語言在asp.net中。

您不能在常規JS警報框中顯示格式化的表。 警報功能會打開一個OS \\ Web瀏覽器憤慨窗口,該窗口不會顯示HTML。

您可以選擇使用任何可用的模式對話框JS插件,讓您創建類似的內容。

這是一個使用jQuery的模式對話框和一個表的示例JS FIDDLE示例

的HTML:

<div id="dialog" title="Basic dialog">
  <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
    <table border="1">
        <tr><td>hello</td><td>hello</td><td>hello</td></tr>
        <tr><td>hello</td><td>hello</td><td>hello</td></tr>
        <tr><td>hello</td><td>hello</td><td>hello</td></tr>
        <tr><td>hello</td><td>hello</td><td>hello</td></tr>
        <tr><td>hello</td><td>hello</td><td>hello</td></tr>
    </table>
</div>

JS:

 $(function() {
    $( "#dialog" ).dialog();
  });

有一個擴展器 ,您可以像這樣使用它:

<asp:Panel runat="server" ID="Panel1">
        Hello World!
</asp:Panel>

<ajaxToolkit:ModalPopupExtender ID="MPE" runat="server"
    TargetControlID="LinkButton1"
    PopupControlID="Panel1"
    DropShadow="true" 
    OkControlID="OkButton" 
    CancelControlID="CancelButton" 
    PopupDragHandleControlID="Panel3" >
        <Animations>
            <OnShowing> ..  </OnShowing>
            <OnShown>   ..  </OnShown>    
            <OnHiding>  ..  </OnHiding>            
            <OnHidden>  ..  </OnHidden>            
        </Animations>
    </ajaxToolkit:ModalPopupExtender>

您在該面板中輸入的內容都會彈出。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM