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

Extend RadPageView using ascx

3 Answers 101 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Baris
Top achievements
Rank 1
Baris asked on 17 Jan 2014, 03:36 PM

I am using radmultipage. I want to extend radpageview using ascx. So I want to add myRadPageview to radmultipage at runtime. At runtime I can add myRadPageview to radmultipage like that


  

deneme = new Page1();
deneme.ID = "123
RadMultiPage1.PageViews.Add(deneme);
RadMultiPage1.SelectedIndex = 0;


After that I add myRadPageview to radmultipage but controls in myRadPageview doesn't exist when I clicked view source in my browser



 

   < div id="RadMultiPage1"><br>           <br>           </div><div id="123"><br>        <br>           </div><input id="RadMultiPage1_ClientState" name="RadMultiPage1_ClientState" type="hidden" /><br>          </div>




page1.ascx.cs

   

public partial class Page1 : Telerik.Web.UI.RadPageView{
 public Page1{
int i = 5
}
protected void Page_Load(object sender, EventArgs e; ; }
{}


page1.ascx



    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Page1.ascx.cs" Inherits="Organon.IM.Presentation.ModellingModule.Page1" %><br>    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %><br>    <br>    <telerik:RadPageView ID="rpv1" runat="server" Height="159px" Width="163px"><br>    <br>        <
 
asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br>       
 <asp:Button ID="Button1" runat="server" Text="Button32432"/><br>
 
    <br>    </telerik:RadPageView>


Why controls which in page1 doesn't show in radmultipage?

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 18 Jan 2014, 08:36 AM
Hi Baris,

Please have a look into the sample code snippet which works fine at my end.

ASPX:
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1">
    <Tabs>
        <telerik:RadTab Text="Tab1" Selected="true">
        </telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server">
</telerik:RadMultiPage>

ASCX:
<asp:Label ID="label1" runat="server" Text="Tab1">
</asp:Label>
<telerik:RadButton ID="RadButton1" runat="server" Text="Submit">
</telerik:RadButton>

ASPX C#:
protected void Page_Init(object sender, EventArgs e)
{
    RadPageView pageview = new RadPageView();
    pageview.ID = "RadPageView1";
    Control ctrl = Page.LoadControl("PageView.ascx");
    pageview.Controls.Add(ctrl);
    RadMultiPage1.PageViews.Add(pageview);
    RadMultiPage1.SelectedIndex = 0;
}

Thanks,
Princy.
0
Baris
Top achievements
Rank 1
answered on 18 Jan 2014, 11:11 AM
what did you write in aspx.cs?

public
 partial class Page1 : Telerik.Web.UI.RadPageView{

or

public partial class Page1 : System.Web.UI.UserControl {

both of them I get different errors
0
Princy
Top achievements
Rank 2
answered on 20 Jan 2014, 05:01 AM
Hi Baris,

Please have a look into the C# code snippet which works fine at my end. Please elaborate your requirement if it doesn't help.

C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
public partial class RadTabStrip_AddUserControlPageView : System.Web.UI.Page
{
    protected void Page_Init(object sender, EventArgs e)
    {
        RadPageView pageview = new RadPageView();
        pageview.ID = "RadPageView1";
        Control ctrl = Page.LoadControl("PageView.ascx");
        pageview.Controls.Add(ctrl);
        RadMultiPage1.PageViews.Add(pageview);
        RadMultiPage1.SelectedIndex = 0;
    }
}

Thanks,
Princy.
Tags
TabStrip
Asked by
Baris
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Baris
Top achievements
Rank 1
Share this question
or