This is a migrated thread and some comments may be shown as answers.

PageViewCreated fires on its own

1 Answer 49 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Lighthouse Developer
Top achievements
Rank 1
Lighthouse Developer asked on 25 May 2010, 03:40 PM
Well, maybe not on its own. My problem is that it fires before even Page_Load. I have the following code to create each page view programmatically :

        protected void Multipage1PageViewCreated(object sender, RadMultiPageEventArgs e) 
        { 
            RadPageView newpage = e.PageView; 
 
            RadEditor editor = new RadEditor { ID = "radeditor" + e.PageView.Index, Width = 800}; 
 
            UpdatePanel updatepanel = new UpdatePanel 
                                          { 
                                              ID = "updatepanel" + e.PageView.Index, 
                                              UpdateMode = UpdatePanelUpdateMode.Conditional 
                                          }; 
 
            //RadioButtonList Start  
            RadioButtonList rbl = new RadioButtonList {RepeatDirection = RepeatDirection.Vertical, Width = 130}; 
            rbl.SelectedIndexChanged += new EventHandler(RadioButtonListEditModeSelectedIndexChanged); 
            rbl.AutoPostBack = true
 
 
            ListItem li1 = new ListItem(); 
            ListItem li2 = new ListItem(); 
            ListItem li3 = new ListItem(); 
            rbl.ID = "radiobuttonlist" + e.PageView.Index; 
            li1.Value = "FullSet"
            li1.Text = "Advanced toolset"
            li2.Value = "Default"
            li2.Text = "Default"
            li3.Value = "BasicTools"
            li3.Text = "Basic toolset"
            rbl.Items.Add(li1); 
            rbl.Items.Add(li2); 
            rbl.Items.Add(li3); 
            //RadioButtonList End  
 
            Literal ltr = new Literal 
            { 
                Text = "<div class=\"radiobuttonlist\"><b>Choose a toolbar style:</b>" 
            }; 
            Literal ltr2 = new Literal { Text = "</div>" }; 
            Literal ltrTitle = new Literal {Text = "<h2>Τίτλος</h2>"}; 
            TextBox txtTitle = new TextBox(); 
            txtTitle.Width = 800; 
            txtTitle.Height = 20; 
            Literal ltrDivStart = new Literal {Text = "<div class='ArticleTitle'>"}; 
            Literal ltrDivEnd = new Literal {Text = "</div>"}; 
            Literal ltrDivStart2 = new Literal { Text = "<div style='float:left;'>" }; 
            Literal ltrDivEnd2 = new Literal { Text = "</div>" }; 
            updatepanel.ContentTemplateContainer.Controls.Add(editor); 
            updatepanel.ContentTemplateContainer.Controls.Add(ltr); 
            updatepanel.ContentTemplateContainer.Controls.Add(rbl); 
            updatepanel.ContentTemplateContainer.Controls.Add(ltr2); 
 
            newpage.Controls.Add(ltrDivStart); 
            newpage.Controls.Add(ltrTitle); 
            newpage.Controls.Add(txtTitle); 
            newpage.Controls.Add(ltrDivEnd); 
            newpage.Controls.Add(ltrDivStart2); 
            newpage.Controls.Add(updatepanel); 
            newpage.Controls.Add(ltrDivEnd2); 
            HiddenField hiddenField = new HiddenField(); 
            hiddenField.Value = Languages[e.PageView.Index]; 
            newpage.Controls.Add(hiddenField); 
        } 
 

This was suggested by a member of the team. Now, outside of the control that contains the tab strip and multi page and all that I have an asp:Button. On its OnClick event I want to get the values of everything in this control. My problem is that PageViewCreated fires before everything else when I click the button. Before the function I have for OnClick and before Page_Load. Any solutions? Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 26 May 2010, 03:21 PM
Hi,

Actually this is expected behavior, PageViewCreated event is fired before Page_Load, because the controls should be added exactly at this moment to the Controls collection of the pageview. What exactly is the problem with this, please explain in more details?

Kind regards,
Yana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TabStrip
Asked by
Lighthouse Developer
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or