Rebinding RadTabStrip on RadPageView Content url postback

8 posts, 1 answers
  1. Manikandan Balasubramaniyan
    Manikandan Balasubramaniyan avatar
    17 posts
    Member since:
    Feb 2010

    Posted 13 Jun 2011 Link to this post

    Hi,

    I have a  RadTabStrip and a RadMultiPage in my MainPage.aspx. 
    And i am loading the PageView from code behind .
    PageView1.ContentUrl =  url;

     <telerik:RadTabStrip ID="RadTabStrip1" SelectedIndex="0" runat="server"                
           MultiPageID="RadMultiPage1" Orientation="VerticalLeft" ontabclick="RadTabStrip1_TabClick">                
      </telerik:RadTabStrip>   
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" Height="800" Width="800"  
             <telerik:RadPageView  ID="PageView1" runat="server">                
             </telerik:RadPageView>                  
     </telerik:RadMultiPage>

    Upon the click of "Save" button in webform (contenturl) , i have to rebind the Tabstrip .

    There seems to be no event which triggers the radtabstrip binding event in my MainPage.aspx.

    Let me know if there anything available to fix this.

    Thanks,
    Mani
  2. Manikandan Balasubramaniyan
    Manikandan Balasubramaniyan avatar
    17 posts
    Member since:
    Feb 2010

    Posted 15 Jun 2011 Link to this post

    Am just following up on this issue.

    Thanks,
    Mani
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 16 Jun 2011 Link to this post

    Hi Manikandan,

    Could you specify how exactly you are binding your tabstrip? In case you bind it in page load event then it should be bound again once a post-back occurs.

    Please try to provide more information regarding you specific scenario, so we could help you out.

    All the best,
    Dimitar Terziev
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  5. Manikandan Balasubramaniyan
    Manikandan Balasubramaniyan avatar
    17 posts
    Member since:
    Feb 2010

    Posted 16 Jun 2011 Link to this post

    Hi Dimitar,

    I want to know how to detect the Postback happening in the "ContentUrl"  of the pageview. 
    Eg. When i hit Save button in the "ContentUrl",  i expected that postback will happen Mainpage.aspx, so that i can handle rebinding of tabstrip.  But postback is happening only WITHIN the "ContentUrl".  

    Do you suggest any different approach so that postback happens in Mainpage.aspx, which has the tabstrip and Multipage.
    When a click event happens in the contenturl?


    Following is the content of Mainpage.aspx page:
    <telerik:RadTabStrip ID="RadTabStrip1" SelectedIndex="0" runat="server"
    MultiPageID="RadMultiPage1" Skin="Outlook" EnableAjaxSkinRendering="true"
    Orientation="VerticalLeft" ontabclick="RadTabStrip1_TabClick">               
    </telerik:RadTabStrip>

     <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0"Height="800" Width="800">           
                <telerik:RadPageView  ID="PageView1" runat="server">                                                            
                </telerik:RadPageView>                
    </telerik:RadMultiPage>

    Following is the Mainpage.aspx.cs code:
       protected void Page_Load(object sender, EventArgs e)
       { 
               BindTabStrip();              
       }
       private void BindTabStrip()
       {
          ds = getTabsDataSet();     
           foreach (DataRow dr in ds.Tables[0].Rows)
           {
               RadTab tab = new RadTab();
               tab.Text =dr["FORM_NAME"].ToString();
               tab.Attributes.Add("web_form_id", dr["web_form_id"].ToString());
               RadTabStrip1.Tabs.Add(tab);
            }
       }
    protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
       {
          ds = getTabsDataSet();    
           int count = 0;
           foreach (DataRow dr in ds.Tables[0].Rows)
           {
              if (e.Tab.Attributes["web_form_id"].ToString() == dr["web_form_id"].ToString())
               {
                  PageView1.ContentUrl = ResolveUrl(".." + dr["form_url"].ToString());  
               }
                count++;
           }
       }


    Thanks,
    Mani


  6. Manikandan Balasubramaniyan
    Manikandan Balasubramaniyan avatar
    17 posts
    Member since:
    Feb 2010

    Posted 19 Jun 2011 Link to this post

    Am just following up on this issue.

    Thanks,
    Mani
  7. Answer
    Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 21 Jun 2011 Link to this post

    Hi Manikandan,

    The behaviour you are experiencing is the default one, when using the ContentUrl property of the RadPageView. When the above mentioned property is used the content of the pageview is rendered in "iframe" and thus when a post-back occurs only the page in the iframe is firing its page load event. If you want the event of the main page to be fired you should use user controls for the content of the pageviews.

    Regards,
    Dimitar Terziev
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  8. Rick
    Rick avatar
    2 posts
    Member since:
    Jul 2011

    Posted 02 Jan 2012 Link to this post

    I have a similar issue. I have a radtreeview on a page containing a list of names. Addresses and other details are shown and updated on radmultipage pageviews using contenturls. The detailed address records in the contenturls are retrieved by clicking on the nodes of the radtreeview. This is one part of a complex application with multiple pages so placing all of the user controls on the main page is impractical.

    The problem with using contenturls is that I can find no way to access the controls on the main page. What I want to do is trigger an update to the radtreeview on the main page when the data on the contenturl page is updated. The approach I want to use is to trap for a linqdatasource updated/inserted/deleted event, and make a call to a method or function on the main page that will rebind the treeview to reflect the changes, similar to the approach below.
    public void UpdateContactsTree(object sender)
        {
            tvContacts.DataBind();
            string sessval = (string)Session["NAID"];
            RadTreeNode node = tvContacts.FindNodeByValue(sessval);
            if (node != null)
            {
                tvContacts.Focus();
                node.Selected = true;
            }
        }

    I tried setting Previouspagetype to the main page on the contenturl, which would expose the method above, but Previouspagetype returns null since the contenturl has focus within the main page but the url has not actually changed.

    Is there some other approach you could recommend to trigger re-databinding the treeview when the record has been updated through a contenturl?
  9. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 03 Jan 2012 Link to this post

    Hi Rick,

    In general when you load a page in an iframe, you could not access the controls on the parent page from the code-behind of the page being loaded in the iframe. You could only access them client-side and only when both pages are of one and the same domain otherwise this would not be possible as well due to cross site scripting. My suggestion is to access the main page client-side and then trigger an action which will update the RadTreeView.

    Regards,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017