在线等!asp.net 遇问题!求助高手解答。

如图,有4个域,分别放着四个gridview,但是点击编辑按钮。回发后又会自动显示第一个域,弄的人老迷瞪。求高手帮助让,回发后记录上次页面显示的域,不让跳到第一个。

 

前台页面部分代码如下:

<div id="lib_Tab2">
        <div class="lib_Menubox lib_tabborder">
            <ul>
                <li id="two1" onclick="setTab('two',1,4)" class="hover">联系人</li>
                <li id="two2" onclick="setTab('two',2,4)">联系活动</li>
                <li id="two3" onclick="setTab('two',3,4)">销售记录</li>
                <li id="two4" onclick="setTab('two',4,4)">相关文档</li>
            </ul>
        </div>
        <div class="lib_Contentbox lib_tabborder">
            <div id="con_two_1">
                <asp:GridView ID="GewLianxi" runat="server" Width="970px" AllowPaging="True" AutoGenerateColumns="False"
                    PageSize="3" OnPageIndexChanging="GewLianxi_PageIndexChanging" OnRowCancelingEdit="GewLianxi_RowCancelingEdit"
                    OnRowEditing="GewLianxi_RowEditing" OnRowUpdating="GewLianxi_RowUpdating" DataKeyNames="lxr_id"
                    OnRowDeleting="GewLianxi_RowDeleting" OnRowCreated="GewLianxi_RowCreated" OnRowDataBound="GewLianxi_RowDataBound">
                    <PagerSettings FirstPageText="首页" LastPageText="末页" NextPageText="下一页" PreviousPageText="上一页" />
                    <Columns>
                        <asp:BoundField DataField="lxr_name" HeaderText="姓名" />
                        <asp:BoundField DataField="lxr_chenghu" HeaderText="称呼" />
                        <asp:BoundField DataField="lxr_department" HeaderText="部门" />
                        <asp:BoundField DataField="lxr_job" HeaderText="职务" />
                        <asp:BoundField DataField="lxr_officecall" HeaderText="办公电话" />
                        <asp:BoundField DataField="lxr_facsimile" HeaderText="传真" />
                        <asp:BoundField DataField="lxr_telephone" HeaderText="手机" />
                        <asp:BoundField DataField="lxr_email" HeaderText="电子邮箱" />
                        <asp:BoundField DataField="lxr_qq" HeaderText="QQ" />
                        <asp:BoundField DataField="lxr_msn" HeaderText="MSN" />
                        <asp:BoundField DataField="lxr_birthday" HeaderText="生日" DataFormatString="{0:yyyy-mm-dd}"
                            ReadOnly="true" />
                        <asp:BoundField DataField="lxr_address" HeaderText="家庭地址" />
                        <asp:BoundField DataField="lxr_remark" HeaderText="备注" />
                        <asp:CommandField HeaderText="编辑" ShowEditButton="True" />
                        <asp:TemplateField HeaderText="删除" ShowHeader="True">
                            <ItemTemplate>
                                <asp:LinkButton ID="lkbdel" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="删除"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle HorizontalAlign="Left" />
                </asp:GridView>
            </div>
            <div id="con_two_2" style="display: none">
                <asp:GridView ID="GewHuodong" runat="server" Width="970px" AllowPaging="True" AutoGenerateColumns="False"
                    PageSize="3" OnPageIndexChanging="GewHuodong_PageIndexChanging" DataKeyNames="h_id"
                    OnRowDeleting="GewHuodong_RowDeleting" OnRowCreated="GewHuodong_RowCreated">
                    <PagerSettings FirstPageText="首页" LastPageText="末页" NextPageText="下一页" PreviousPageText="上一页" />
                    <Columns>
                        <asp:BoundField DataField="h_time" DataFormatString="{0:yyyy-MM-dd}" HeaderText="日期" />
                        <asp:BoundField DataField="h_fangshi" HeaderText="活动方式" />
                        <asp:BoundField DataField="h_theme" HeaderText="主题" />
                        <asp:BoundField DataField="h_desc" HeaderText="描述" />
                        <%--<asp:CommandField HeaderText="编辑" ShowEditButton="True" />--%>
                        <asp:TemplateField HeaderText="删除" ShowHeader="True">
                            <ItemTemplate>
                                <asp:LinkButton ID="lkbdel" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="删除"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
            </div>

            <div id="con_two_3" style="display: none">
                <asp:GridView ID="Gewxiaoshou" runat="server" Width="970px" AllowPaging="True" AutoGenerateColumns="False"
                    PageSize="3" OnPageIndexChanging="Gewxiaoshou_PageIndexChanging" DataKeyNames="x_id"
                    OnRowDeleting="Gewxiaoshou_RowDeleting" OnRowCreated="Gewxiaoshou_RowCreated"
                    OnRowCancelingEdit="Gewxiaoshou_RowCancelingEdit" OnRowEditing="Gewxiaoshou_RowEditing"
                    OnRowUpdating="Gewxiaoshou_RowUpdating" OnRowDataBound="Gewxiaoshou_RowDataBound">
                    <PagerSettings FirstPageText="首页" LastPageText="末页" NextPageText="下一页" PreviousPageText="上一页" />
                    <Columns>
                        <asp:BoundField DataField="x_time" DataFormatString="{0:yyyy-MM-dd}" ReadOnly="true"
                            HeaderText="日期" />
                        <asp:BoundField DataField="x_order" HeaderText="单号" />
                        <asp:BoundField DataField="x_pname" HeaderText="产品名称" />
                        <asp:BoundField DataField="x_model" HeaderText="型号" />
                        <asp:BoundField DataField="x_guige" HeaderText="规格" />
                        <asp:BoundField DataField="x_cost" HeaderText="成本价" />
                        <asp:BoundField DataField="x_selling" HeaderText="销售价" />
                        <asp:BoundField DataField="x_num" HeaderText="数量" />
                        <asp:BoundField DataField="x_unit" HeaderText="单位" />
                        <asp:BoundField DataField="x_discount" HeaderText="折扣" />
                        <asp:BoundField DataField="x_jiaoyie" HeaderText="交易额" />
                        <asp:BoundField DataField="x_fapiao" HeaderText="发票" />
                        <asp:BoundField DataField="x_zhuangtai" HeaderText="销售状态" />
                        <asp:BoundField DataField="x_remindday" DataFormatString="{0:yyyy-MM-dd}" ReadOnly="true"
                            HeaderText="提醒日期" />
                        <asp:BoundField DataField="x_remark" HeaderText="备注" />
                        <asp:CommandField HeaderText="编辑" ShowEditButton="True" />
                        <asp:TemplateField HeaderText="删除" ShowHeader="True">
                            <ItemTemplate>
                                <asp:LinkButton ID="lkbdel" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="删除"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
            </div>
            <div id="con_two_4" style="display: none">
                <asp:GridView ID="Gewtxt" runat="server" Width="970px" AllowPaging="True" AutoGenerateColumns="False"
                    PageSize="3" OnPageIndexChanging="Gewtxt_PageIndexChanging" DataKeyNames="d_id"
                    OnRowDeleting="Gewtxt_RowDeleting" OnRowCreated="Gewtxt_RowCreated">
                    <PagerSettings FirstPageText="首页" LastPageText="末页" NextPageText="下一页" PreviousPageText="上一页" />
                    <Columns>
                        <asp:BoundField DataField="d_type" HeaderText="文档类型" />
                        <asp:BoundField DataField="d_path" HeaderText="路径" />
                        <asp:BoundField DataField="d_remark" HeaderText="备注" />
                        <%--                        <asp:CommandField HeaderText="编辑" ShowEditButton="True" />--%>
                        <asp:TemplateField HeaderText="删除" ShowHeader="True">
                            <ItemTemplate>
                                <asp:LinkButton ID="lkbdel" runat="server" CausesValidation="False" CommandName="Delete"
                                    Text="删除"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
            </div>
        </div>
    </div>

最佳答案
本回答由提问者推荐

2010-09-30 回答
你的问题呢?
追问:

不好意思,刚不小心,点这提交了。

现在有了,看补充

追答:

不用层可以么?用一个控件TabContainer,是一个AJAX控件

<asp:ScriptManager ID="ScriptManager1" runat="server">     </asp:ScriptManager>     <asp:UpdatePanel ID="UpdatePanel1" runat="server">         <ContentTemplate>

<!--  ------------------------------------------------------------------------------------------------------------------ >         <cc1:TabContainer ID="TabContainer1" runat="server" CssClass="AjaxTabStrip">             <cc1:TabPanel runat="server" ID="TabPanel1" HeaderText="联系人">                 <ContentTemplate>

                   //这里放你每个层里的代码

                </ContentTemplate>             </cc1:TabPanel>

            <cc1:TabPanel runat="server" ID="TabPanel1" HeaderText="联系活动">                 <ContentTemplate>

                   //这里放你每个层里的代码

                </ContentTemplate>             </cc1:TabPanel>

            ....

<!--  ------------------------------------------------------------------------------------------------------------------ >

2010-09-30 回答
什么问题啊
追问:

不好意思,刚不小心,点这提交了。

现在有了,看补充。

追答:
点编辑的时候是在本页面编辑吗 快点回答我
追问:
对,是的。
追答:

当编辑完事的时候 你再跳到本页面Response.Redirect("Default.aspx?flag=1");

联系人编辑完事:Response.Redirect("Default.aspx?flag=2");

然后再Default页面加载的时候获取参数 进行相应的判断

if(如果参数等于2)

{

联系人域显示

}

能明白我的意思吗

追问:

现在的问题是:比如你点销售记录里编辑的时候,页面就会显示在联系人呐个域里面,还要在点一下销售记录,才能看到销售记录编辑状态。

 

我加你QQ你设置问题了,能加我么?416471940