日期:2014-05-17  浏览次数:20363 次

进入asp.net 页面时如何弹出对话框,让用户选择一些参数
如省。然后我想将用户选择的参数,来提取数据。

------解决方案--------------------
可以考虑先弹出一个jbox框或其他的框
------解决方案--------------------
用div做,等用户选择完毕后用Javascript设置div的display属性为none即可
------解决方案--------------------
jquery的colorbox

http://www.jacklmoore.com/colorbox
------解决方案--------------------
可以的,要JS弹出模式窗口,然后将模式窗口选择的值返回到主窗口,主窗口再通过回传的值来进行检索。
例:
主窗口
HTML code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModelDialogMain.aspx.cs"
    Inherits="testWeb.ModelDialogMain" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label2" runat="server" Text=""></asp:Label><br />
        <asp:Label ID="Label1" runat="server" Text="Condition"></asp:Label>
        <asp:TextBox ID="txtCondition" runat="server"></asp:TextBox><br />
        <asp:Button ID="btnShowCondition" runat="server" Text="ShowSelect" />
    </div>
    </form>
    <script type="text/javascript">
        // 打开选择子窗体
        var result = window.showModalDialog("ModelDialogSub.aspx", "", "dialogWidth=" + 100 + "px;dialogHeight=" + 100 + "px;resizable:yes;")
        // 返回值赋值给检索条件
        var txtCond = document.getElementById("txtCondition");
        txtCond.value = result;
    </script>
</body>
</html>