English 中文(简体)
ajaxtoolkit 背后问题
原标题:ajaxtoolkit postback problem

i 正在执行一个项目。 但有问题。 基本上,一是使用亚xtoolkit tabcontainer。 假设有两条表格,一是制造的。 让我们打上表1,表2.in,表1中有一个子和文字箱。 在点击纽顿时,i 正在撰写一些案文。 当时,我正在积极制造一个表象。 假设它被称为“表3”。 问题在于,在表1表1中点击纽子,表3正在消失。 如何防止这种情况?

   <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"  AutoPostBack="true"
        Height="273px" Width="1050px">
        <asp:TabPanel runat="server" HeaderText="tab1" ID="tab1">       
    <ContentTemplate>


tab2

here is where i am adding a new tab in the function:

       AjaxControlToolkit.TabPanel tp = new AjaxControlToolkit.TabPanel();
        tp.HeaderText = "tab3";
        tp.ContentTemplate = Page.LoadTemplate("WebUserControl1.ascx");
        tp.ID = "tab3";
        TabContainer1.Tabs.Add(tp);

页: 1

问题回答

When dealing with any dynamic controls, you will need to re-add them after every postback. My recommendation is to store your dynamically-added controls in the ViewState, and write a method that retrieves the information from ViewState and adds your tabs. Then call this method from Page_Init.





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签