注册 登录
编程论坛 ASP.NET技术论坛

怎么弹出一个这样的窗体呢?

lmyh5201 发布于 2008-09-24 13:55, 1734 次点击
当点击DATALIST里的一个按钮时,弹出一个这样的窗体怎么实现阿?
15 回复
#2
lmyh52012008-09-24 15:30
没有人会吗?
#3
徐强2008-09-24 15:55
自己做个层就是了?很难么?
#4
lmyh52012008-09-24 16:06
我不会阿
#5
徐强2008-09-24 16:07
设计一个   放在div里  用脚本控制弹出  隐藏
很简单的  给你找个例子看
#6
徐强2008-09-24 16:20
没法发图片
就直接说吧
<div id='div1'>
里面你放个table   至于怎么设置样式 就是按你自己的意思来了
</div>
你用脚本控制div.style.display="none";隐藏
="";就显示出来了
#7
lyzx36552008-09-24 17:23
这个 就是  JS代码啊..
简单
#8
lmyh52012008-09-25 09:11
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Blog_Photo_User_List.aspx.cs" Inherits="img_Blog_Photo_User_List" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.

<html xmlns="http://www. >
<head runat="server">
    <title>用户相册</title>
    <script type="text/C#" language="javascript">
    function changeCatalog()
    {
        getCatalogName.style.display="";
    }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:DataList ID="DataList1" runat="server" Width="500px" DataKeyField="ID" OnDeleteCommand="DataList1_DeleteCommand" OnItemDataBound="DataList1_ItemDataBound" OnEditCommand="DataList1_EditCommand" OnItemCommand="DataList1_ItemCommand">
            <EditItemTemplate>
               
            </EditItemTemplate>
            <ItemTemplate>
                <table border="0">
                    <tr>
                        <td rowspan="3" style="width: 151px">
                            <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl='<%# Eval("ImgMin") %>'/></td>
                        <td style="width: 172px; height: 34px">
                            <asp:HyperLink ID="txt_update" runat="server" NavigateUrl="javascript:window.open('getFileName.aspx','','left=450,top=250,width=200,height=200')">改</asp:HyperLink>
                            &nbsp;
                            <asp:LinkButton ID="txt_delete" runat="server">删</asp:LinkButton>
                            &nbsp;
                            <asp:LinkButton ID="txt_move" runat="server" OnClick="changeCatalog()">移</asp:LinkButton>
                            排序:<asp:LinkButton ID="MyOrderIDUp" runat="server">↑</asp:LinkButton>&nbsp;
                            <asp:LinkButton ID="MyOrderIDDown" runat="server">↓</asp:LinkButton>
                            <asp:Label ID="txt_ID" runat="server" Visible="False"><%# Eval("ID") %></asp:Label></td>
                    </tr>
                    <tr>
                        <td style="width: 172px; height: 34px">
                            <asp:LinkButton ID="LinkButton2" runat="server">设为形象照</asp:LinkButton></td>
                    </tr>
                    <tr>
                        <td style="width: 172px; height: 36px">
                            <asp:LinkButton ID="LinkButton1" runat="server" Width="82px" CommandName="Commend"><%# ReturnCommend(Eval("Commend").ToString()) %></asp:LinkButton></td>
                    </tr>
                </table>
            </ItemTemplate>
        </asp:DataList>
        <div style="width: 308px; height: 170px;display:none" id="getFileName" >
            <table>
                <tr>
                    <td style="width: 78px">
                        标题:</td>
                    <td colspan="2">
                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                    <td style="width: 78px; height: 80px">
                        简介:</td>
                    <td colspan="2" style="height: 80px">
                        <asp:TextBox ID="TextBox2" runat="server" Height="70px" TextMode="MultiLine" Width="199px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td colspan="3">
                        <asp:LinkButton ID="LinkButton5" runat="server">确定</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton6" runat="server">取消</asp:LinkButton></td>
                </tr>
            </table>
            
        </div>
        <div style="width: 307px; height: 74px;display:none" id="getCatalogName" >
            <table>
                <tr>
                    <td style="width: 273px">
                        请选择分类:</td>
                    <td style="width: 284px">
                        <asp:DropDownList ID="DropDownList1" runat="server">
                        </asp:DropDownList></td>
                    
                </tr>
                <tr>
                    <td colspan="2" style="height: 25px">
                        <asp:LinkButton ID="LinkButton7" runat="server">确定</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton8" runat="server">取消</asp:LinkButton></td>
                    
                </tr>
               
            </table>
        </div>
                <br />
        <webdiyer:AspNetPager ID="AspNetPager1" PageSize="20" runat="server" OnPageChanging="AspNetPager1_PageChanging">
                                    </webdiyer:AspNetPager>
    </div>
    </form>
</body>
</html>

我就是那样写的阿,可是它说并不包含对changeCatalog()的定义阿?怎么回事?
#9
徐强2008-09-25 09:59
还是楼上有心
#10
yms1232008-09-25 10:35
浮动层,严格来说那个并不是窗体,用浮动层模拟了一个窗体出来而已。
#11
lmyh52012008-09-25 12:35
楼上的,给个代码
#12
bygg2008-09-25 12:49
<html>
<head>
    <title>test</title>
    <script language="javascript" type="text/javascript">
    function openDiv()
    {
      
        sWidth=document.body.offsetWidth;
        sHeight=screen.height;         
        
        var bgObj = document.getElementById('divBG');
        bgObj.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=2,opacity=25,finishOpacity=75";
        bgObj.style.opacity="0.5";
        bgObj.style.width = sWidth;
        bgObj.style.height = sHeight;
        bgObj.style.display="inline";
        
        var bgObjCtrl = document.getElementById('divCtrl');
        bgObjCtrl.style.width = sWidth;
        bgObjCtrl.style.display="inline";
        document.all("b1").disabled=true;
        
    }
    function closeDiv()
    {
        divBG.style.display="none";
        divCtrl.style.display="none";
        document.all("b1").disabled=false;
    }
    </script>
</head>

<body>
    <div>
        <a id="b1" onclick="openDiv();" style="cursor:hand; color:Blue;">点一下</a>
    </div>
    <div id="divBG"
    style="display:none; position: absolute; left:0px; top:0px; background-color:#C0C0C0;">
    </div>
    <div id="divCtrl" class="" style="display:none; position: absolute; background-color:Transparent; width:400px; top:0px; left:200px;">
        <table width="100%">
            <tr>
                <td style="height:180px;"></td>
            </tr>
            <tr>
                <td>
                    <table id="tb1" style="background-color:#C6D5F5; width:280px; border-color:#999999" border="0px"; cellpadding="0" cellspacing="1">
                        <tr>
                            <td align="right" ><a onclick="closeDiv();" style="cursor:hand"><B><font color="red">关闭</font></B>&nbsp;</a></td>
                        </tr>
                        <tr>
                            <td style="background-color:White;"></td>
                        </tr>
                        <tr>
                            <td align="center" style="background-color:White; width:35%"><br />这是你刚刚打开的层<br /></td>
                        </tr>
                        <tr>
                            <td colspan="2" style="background-color:#D4D4D4; height:15px;"></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        </div>
</body>
</html>
#13
lmyh52012008-09-25 13:19
谢谢了
#14
lmyh52012008-09-25 14:44
怎么可以让层可以拖拽呢?
#15
徐强2008-09-27 14:17
我都给出来方法了,非要完整代码。
没写过的代码,可以自己尝试一下
要不和那些培训出来的一样了,给什么代码就会什么
#16
yms1232008-09-27 15:30
[bo][un]徐强[/un] 在 2008-9-27 14:17 的发言:[/bo]

我都给出来方法了,非要完整代码。
没写过的代码,可以自己尝试一下
要不和那些培训出来的一样了,给什么代码就会什么

同意,自己想出来比别人写出来更有意义,程序员举一反三的能力很重要。
1