PageViewCreated fires on its own

2 posts, 0 answers
  1. Lighthouse Developer
    Lighthouse Developer avatar
    34 posts
    Member since:
    Feb 2010

    Posted 25 May 2010 Link to this post

    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"
                //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>" }; 
                HiddenField hiddenField = new HiddenField(); 
                hiddenField.Value = Languages[e.PageView.Index]; 

    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.
  2. Yana
    Yana avatar
    5044 posts

    Posted 26 May 2010 Link to this post


    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,
    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.
Back to Top