I had a page where i'm creating ajax tab panels dynamically on button click (they will be more than 50 tabs creating). so i am trying to create all the tabs at once and loading the controls (i.e. user control) to only first tab (so it will not effect performance).
user control has a gridview containg table format with name and relation as below (as in user control)
name relation1 relation2 relation3 relation4
abc check -- -- --
def -- check -- --
if user changes the above relation for the respective name(s) and clicks on other tab. prior tab changes has to be saved but not able to find the changes made by user in prior tab on activetab_changed event for saving.
I struck in saving prior tab data changes.
my tab container has autopostback="true" and it is in updatepanel
Thanks for replying for my post. No change I observed. I am creating the 50 tabs on button click and loading the controls to the tabpanels on demand. but still i'm not able to get the changes made in the prior active tab.
load only selected tabpanel and while changing to some other tab, save this tabpanel changes and load the requested tab. Can anyone help me in how to do this using asp.net, ajax and c#
sunilkva
Member
18 Points
34 Posts
Dynamic tab panel loading and prior tab data changes saving asp.net ajax c#
Feb 23, 2012 10:29 AM|LINK
Hi All,
I had a page where i'm creating ajax tab panels dynamically on button click (they will be more than 50 tabs creating). so i am trying to create all the tabs at once and loading the controls (i.e. user control) to only first tab (so it will not effect performance).
user control has a gridview containg table format with name and relation as below (as in user control)
name relation1 relation2 relation3 relation4
abc check -- -- --
def -- check -- --
if user changes the above relation for the respective name(s) and clicks on other tab. prior tab changes has to be saved but not able to find the changes made by user in prior tab on activetab_changed event for saving.
I struck in saving prior tab data changes.
my tab container has autopostback="true" and it is in updatepanel
Please help me. thanks in advance
chetan.sarod...
All-Star
65749 Points
11148 Posts
Re: Dynamic tab panel loading and prior tab data changes saving asp.net ajax c#
Feb 24, 2012 02:33 AM|LINK
Hi, Please refer this
http://forums.asp.net/t/1621178.aspx/1
http://stackoverflow.com/questions/5432413/dynamically-create-controls-and-save-the-controls-values-across-postback-asp-n
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
sunilkva
Member
18 Points
34 Posts
Re: Dynamic tab panel loading and prior tab data changes saving asp.net ajax c#
Feb 24, 2012 12:22 PM|LINK
Hi,
Thanks for replying for my post. No change I observed. I am creating the 50 tabs on button click and loading the controls to the tabpanels on demand. but still i'm not able to get the changes made in the prior active tab.
please help me.
Song-Tian - ...
All-Star
43697 Points
4304 Posts
Microsoft
Re: Dynamic tab panel loading and prior tab data changes saving asp.net ajax c#
Feb 27, 2012 08:21 AM|LINK
Hi,
Please post the related code.
Feedback to us
Develop and promote your apps in Windows Store
sunilkva
Member
18 Points
34 Posts
Re: Dynamic tab panel loading and prior tab data changes saving asp.net ajax c#
Feb 27, 2012 11:55 AM|LINK
Here is what I'm doing
To Create TabPanels in TabContainer
---------------------------------------------------
private void AddPanel()
{
TabPanel tp = new TabPanel();
tp.BorderWidth = 0;
tp.Visible = true;
TCGroupFolderPermissions.Tabs.Add(tp);
TCGroupFolderPermissions.BorderWidth = 0;
}
/// <summary>
/// Method to create new tab dynamically
/// </summary>
/// <param name="groupname"></param>
/// <param name="grouptype"></param>
public void CreateTab(string groupname, string grouptype)
{
AddPanel();
if (TabCount == 0)
TCGroupFolderPermissions.ActiveTabIndex = 0;
TabCount++;
TCGroupFolderPermissions.Tabs[TabCount - 1].HeaderText = groupname.ToString();
if (grouptype == "0")
{
TCGroupFolderPermissions.Tabs[TabCount - 1].ToolTip = "Generic group.";
}
else { TCGroupFolderPermissions.Tabs[TabCount - 1].ToolTip = "Custom group."; }
}
in load tabs button click
-----------------------------
for (int i = 0; i < Convert.ToInt32(txt1.Text); i++)
{
CreateTab("Tab " + i.ToString(), i.ToString());
}
After that In Page_Prerender
--------------------------------
if (TCGroupFolderPermissions.ActiveTab != null)
{
if (TCGroupFolderPermissions.Tabs.Count > 0)
{
foreach (TabPanel tp in TCGroupFolderPermissions.Tabs.Cast<TabPanel>().Where(q => q.HeaderText == TCGroupFolderPermissions.ActiveTab.HeaderText && q.Controls.Count == 0))
{
Control permissionControl = LoadControl("~/usercontrols/Permissions3.ascx");
tp.Controls.Add(permissionControl);
InsertProjectGroup(7, "", "0", 0);
using (DataSet dsProjGroupType = adataset.Copy())
{
foreach (DataRow groupname in dsProjGroupType.Tables[0].Rows.Cast<DataRow>().Where(q => Convert.ToString(q["ProjectGroupName"]) == Convert.ToString(tp.HeaderText)))
{
loadInitialUsers(groupname);
}
}
}
}
}
So when i change active tab in page_prerender controls are added to that tab but prior tab changes is missing.
Please help me..
Thanks in Advance
Song-Tian - ...
All-Star
43697 Points
4304 Posts
Microsoft
Re: Dynamic tab panel loading and prior tab data changes saving asp.net ajax c#
Feb 29, 2012 08:41 AM|LINK
Hi,
Please create a sample website of that. And send to me. I will reproduct on my side. My email:support-sotian@live.com
Feedback to us
Develop and promote your apps in Windows Store
sunilkva
Member
18 Points
34 Posts
Re: Dynamic tab panel loading and prior tab data changes saving asp.net ajax c#
Mar 01, 2012 10:59 AM|LINK
Hi,
load only selected tabpanel and while changing to some other tab, save this tabpanel changes and load the requested tab. Can anyone help me in how to do this using asp.net, ajax and c#
Song-Tian - ...
All-Star
43697 Points
4304 Posts
Microsoft
Re: Dynamic tab panel loading and prior tab data changes saving asp.net ajax c#
Mar 02, 2012 12:41 AM|LINK
Hi,
Please try the code as follow:
<script type="text/javascript"> Sys.Extended.UI.TabPanel.prototype._header_onclick = function () { alert("hi"); this.raiseClick(); this.get_owner().set_activeTab(this); }; </script>Feedback to us
Develop and promote your apps in Windows Store
sunilkva
Member
18 Points
34 Posts
Re: Dynamic tab panel loading and prior tab data changes saving asp.net ajax c#
Mar 07, 2012 12:50 PM|LINK
Hi All,
I resolved my issue in another way..
thanks for your support.