简体   繁体   English

如何在Java脚本弹出窗口中显示表格格式的数据

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

Hi how to display table formatted data in java script popup. 嗨,如何在Java脚本弹出窗口中显示表格格式的数据。 it is possible to display table formatted data in java script popup. 可以在Java脚本弹出窗口中显示表格式的数据。 in asp.net using C# language. 使用C#语言在asp.net中。

You cannot display formatted tables in a regular JS alert box. 您不能在常规JS警报框中显示格式化的表。 The alert function opens an OS\\ web browser indignant window that dose not display HTML. 警报功能会打开一个OS \\ Web浏览器愤慨窗口,该窗口不会显示HTML。

you alternative is to use any available modal dialog JS plugin that will allow you to create something similar. 您可以选择使用任何可用的模式对话框JS插件,让您创建类似的内容。

here is an example using jQuery's modal dialog with a table: JS FIDDLE Example 这是一个使用jQuery的模式对话框和一个表的示例JS FIDDLE示例

html: 的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: JS:

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

there is an extender and u can use it like this: 有一个扩展器 ,您可以像这样使用它:

<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>

and whatever u put in that panel will be it popup. 您在该面板中输入的内容都会弹出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM