Showing posts with label fix. Show all posts
Showing posts with label fix. Show all posts

Monday, March 26, 2012

Tab Navigation

Im using a gridview inside a tab(1) if i navigate to another tab(2) and then refresh on that tab(2) it takes me back to tab(1).

Anyone know how to fix this?

You need to persist the tab position in viewstate.

Errrh, how do i do that? example please.


Use

Session["PAGENO"] = iPageNo;

To retrieve
if Session["PAGENO"] == null
iPageNo = 1
else
iPageNo = Session["PAGENO"]


Hi, sorry you dont have a c# version do you?

try

if (Session["PAGENO"] == null)
iPageNo = 1;
else
iPageNo = Session["PAGENO"];


does not work, I take iPageNo is a int?


The i prefix indicates that iPageNo in an integer.

Wednesday, March 21, 2012

TabContainer is get back to the first tab each page load

who to fix it?

<ajaxToolkit:TabContainer ID="TabContainer1" runat="server" Height="150px" ActiveTabIndex="0"> <ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="???? ????" > <ContentTemplate> <uc1:Clientdetails ID="Clientdetails1" runat="server" /> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="?????"> <ContentTemplate> <uc2:CommentsList ID="CommentsList1" runat="server" /> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="??????"> <ContentTemplate> <uc3:ClientsOrder ID="ClientsOrder1" runat="server" /> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer>

is there other easy way to do it except using session

is there other easy way to do it except using session>?

well i am kinda new to this myself. But i think removing the ActiveTabIndex="0" property might help, since every page refresh it reads that property again and set the active tab to 0. Thus your first tab.


Hi Roy,

I'm afraid the information you provided isn't sufficient enough to solve it.

I copied your code into my page, but can't reproduce it.

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <ajaxToolkit:TabContainer ID="TabContainer1" runat="server" Height="150px" ActiveTabIndex="0"> <ajaxToolkit:TabPanel ID="TabPanel1" runat="server" HeaderText="???? ????" > <ContentTemplate> <asp:Button ID="Button1" runat="server" Text="Button" /> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel2" runat="server" HeaderText="?????"> <ContentTemplate> <asp:Button ID="Button2" runat="server" Text="Button" /> </ContentTemplate> </ajaxToolkit:TabPanel> <ajaxToolkit:TabPanel ID="TabPanel3" runat="server" HeaderText="??????"> <ContentTemplate> <asp:Button ID="Button3" runat="server" Text="Button" /> </ContentTemplate> </ajaxToolkit:TabPanel> </ajaxToolkit:TabContainer> </form></body></html>