首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

jquery动态创建的内容如何处理刷新后消失

2013-07-04 
高分求教jquery动态创建的内容如何避免刷新后消失+ /trjQuery(#table1).append(tr)})})/script

高分求教jquery动态创建的内容如何避免刷新后消失


                        + "</tr>";
                jQuery("#table1").append(tr)
            });
       
    });
    </script>
    <style type="text/css">
        .style2
        {
            width: 374px;
            border: 1px solid #808080;
            line-height:30px;
        }
        .Border
        {
            border:1px solid #808080;
        }
        .style4
        {
            border: 1px solid #808080;
            height: 24px;
        }
        .style5
        {
            width: 500px;
            height: 112px;
        }
        .style6
        {
            height: 29px;
        }
        </style>
</head>
<body>
    <form id="form1" runat="server">
    <div id="all">
        <input id="Button1" type="button" value="增加" />&nbsp;
        <asp:Button ID="Button3" runat="server" Text="取消" />&nbsp;  
        <input id="Button4" type="button" value="删除" />&nbsp; 
        <asp:Button ID="Button5" runat="server" Text="借取" onclick="Button5_Click"  />
        <br />
        <br />
        <table cellpadding="0" cellspacing="0" class="style2">
            <tr>
                <td class="style4">
                    姓名:</td>
                <td class="style4">
                    &nbsp<asp:TextBox ID="TextBox2" runat="server" Width="152px"></asp:TextBox>


                </td>
            </tr>
            <tr>
                <td class="Border">
                    时间</td>
                <td class="Border">
                    &nbsp<asp:Label ID="Label4" runat="server" Text="Label"></asp:Label>
                </td>
            </tr>
        </table>


        <br />
        <table cellpadding="0" cellspacing="1" class="style5">
            <tr>
                <td class="style6">
                    工具名:<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
                        Height="22px" onselectedindexchanged="DropDownList1_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td class="style6">
                </td>
                <td class="style6">
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>


                    已借出:<asp:Label ID="lblBorrow" runat="server" Text="Label"></asp:Label>
                </td>
                <td>
                    现存:<asp:Label ID="lblNow" runat="server" Text="Label"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    总 数:<asp:Label ID="lblAll" runat="server" Text="Label"></asp:Label>
                </td>
                <td>
                    需求:<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
                <td>


                    &nbsp;</td>
            </tr>
        </table>
        <br />

        <table id="table1" border="1" runat="server"  cellpadding="0" cellspacing="0" width="900px" ></table>
    </div>
    </form>
</body>
</html>



这样一个页面,点击增加就可以增加我填入 选中的信息以表格的形式展现,如何才能使我动态创建的即使在页面刷新后仍然存在呢?还有,求高手亲身指点,这些确实有点不会 数据库什么的我这里都有的 如果有愿意的可加我QQ289278756指导指导我一下
[解决办法]
这个时候不知道你为什么要刷新,需求也要合理吧。
是在要这样也行,你后台给加两个方法Add和Get,然后前台增加一行后,通过ajax调用后台的方法,把临时数据存起来,然后在页面刷新的时候再通过ajax到后台去取,然后显示出来。

热点排行