Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
270
Postback issue for dynamic tabs.
posted

Hi,

Currently I am using trial version of Ultawebtab doing some testing for our requirement. But I am facing an issue.

first let me explain my requirement clearly. When user click on any aspx page link that has to create a new webtab dynamically.

I able to create tabs dynmically with targeturl, but the previous pages are loosing content when I add a new tab.

how should I maintain previous content?, please help me....below is my sample code.

Ex: default page has one textbox, button and ultratab. button event fires & creates new tab with target url based on textbox value.

form0.aspx & form1.aspx are simple forms have one textbox.

TEST Scenario: step1: type 0 in main textbox click on button & type some content in form0 textbox(it would be first tab)

step2: type1 in main text box then click on button. NOW FIRST TAB WILL LOST PREVIOUS VALUE - I NEED TO MAINTAIN IT EITHER VIEWSTATE OR ANY ALTERNATE WAY.

 

Default.aspx:

<form id="form1" runat="server">

 <div><asp:ScriptManager ID="sdf" runat="server"></asp:ScriptManager> 

<asp:UpdatePanel ID="upd" runat="server"><ContentTemplate>

<table><tr><td width="100%">

<asp:TextBox ID="txt" runat="server" />

<asp:Button ID="btn" runat="server" OnClick="btn_Click" Text="Create" />

<igtab:UltraWebTab LoadAllTargetUrls="false" ID="UltraWebTab1" AsyncMode="On" Height=500 runat

="server" BorderWidth="1px" Width="100%" BorderStyle="Solid">

<ClientSideEvents BeforeAsyncSubmit="UltraWebTab1_BeforeAsyncSubmit" />

</igtab:UltraWebTab>

</td></tr></table>

</ContentTemplate></asp:UpdatePanel> 

</div>

</form>

Default.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Infragistics.WebUI.Design;
using Infragistics.WebUI.WebControls;
using Infragistics.WebUI.UltraWebTab;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
    }
    protected void btn_Click(object sender, EventArgs e)
    {
        Tabs tbs = new Tabs();
        if (txt.Text == "0")
        {
            Tab t = new Tab();
            t.Text = "form0.aspx";
            t.ContentPane.TargetUrl = "form0.aspx";
            UltraWebTab1.Tabs.Add(t);
        }
        else if (txt.Text == "1")
        {
            Tab t = new Tab();
            t.Text = "form1.aspx";
            t.ContentPane.TargetUrl = "form1.aspx";
            UltraWebTab1.Tabs.Add(t);
        }        
    }
}

Form0.aspx & Form1:aspx:

<form id="form1" runat="server"><div>form0<asp:TextBox ID="txt" runat="server"></asp:TextBox>

 

 

</div> </form>

 

Thanks in Advance

Vijay.