I try to rebuild the example of 'wizard' but I get the error on line 33: Object reference not set to an instance of an object. I checked the code, but I can't find the solution.
Project.ascx.VB
Preview.ascx
default.aspx.vb
Project.ascx.VB
| Partial Class Project | |
| Inherits System.Web.UI.UserControl | |
| Protected Sub nextButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles nextButton.Click | |
| UpdatePreview() | |
| GoToNextTab() | |
| End Sub | |
| Private Sub GoToNextTab() | |
| Dim tabStrip As RadTabStrip = Page.FindControl("RadTabStrip1") | |
| Dim FileUploadInfoTab As RadTab = tabStrip.FindTabByText("FileUpload") | |
| FileUploadInfoTab.Enabled = True | |
| FileUploadInfoTab.Selected = True | |
| GoToNextPageView() | |
| End Sub | |
| Private Sub GoToNextPageView() | |
| Dim multiPage As RadMultiPage = Page.FindControl("RadMultiPage1") | |
| Dim FileUploadInfoPageView As RadPageView = multiPage.FindPageViewByID("FileUpload") | |
| If FileUploadInfoPageView Is Nothing Then | |
| FileUploadInfoPageView = New RadPageView() | |
| FileUploadInfoPageView.ID = "FileUpload" | |
| multiPage.PageViews.Add(FileUploadInfoPageView) | |
| End If | |
| FileUploadInfoPageView.Selected = True | |
| End Sub | |
| Private Sub UpdatePreview() | |
| Dim previewControl As Control = Page.FindControl("previewControl") | |
| Dim ProjNameLabelPreview As Label = previewControl.FindControl("lblProjectName") | |
| ProjNameLabelPreview.Text = txtProjectName.Text | |
| Dim ProjDescriptionLabelPreview As Label = previewControl.FindControl("ProjDescriptionLabel") | |
| ProjDescriptionLabelPreview.Text = txtProjectDescription.Text | |
| Dim ReferenceLabelPreview As Label = previewControl.FindControl("ReferenceLabel") | |
| ReferenceLabelPreview.Text = txtReference.Text | |
| End Sub | |
| End Class | |
Preview.ascx
| <%@ Control Language="VB" AutoEventWireup="false" CodeFile="PreviewVB.ascx.vb" Inherits="Telerik.Web.Examples.TabStrip.ApplicationScenarios.Wizard.PreviewVB" %> | |
| <h2> | |
| Preview:</h2> | |
| <ul> | |
| <li style="text-align:left;font-weight:bold;"> | |
| <asp:Label runat="server" ID="lblProjectName"></asp:Label> | |
| </li> | |
| <li style="text-align:left;font-weight:bold;"> | |
| <asp:Label runat="server" ID="ProjDescriptionLabel"></asp:Label> | |
| </li> | |
| <li style="text-align:left;font-weight:bold;"> | |
| <asp:Label runat="server" ID="ReferenceLabel"></asp:Label> | |
| </li> | |
| </ul> | |
| <h3> | |
| Files uploaded | |
| </h3> | |
| <ul> | |
| <asp:Label ID="lblNoResults" runat="server" Visible="true">No uploaded files</asp:Label> | |
| <asp:Repeater ID="rpvalidResults" runat="server" Visible="false"><HeaderTemplate>Uploaded Files:<br /> | |
| </HeaderTemplate> | |
| <ItemTemplate> | |
| <%#DataBinder.Eval(Container.DataItem, "FileName")%> | |
| (<%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>) <br /><br /> | |
| </ItemTemplate></asp:Repeater> | |
| </ul> | |
default.aspx.vb
| Partial Class Default2 | |
| Inherits System.Web.UI.Page | |
| Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load | |
| If Not Page.IsPostBack Then | |
| AddTab("Project", True) | |
| Dim pageView As New RadPageView() | |
| pageView.ID = "Project" | |
| RadMultiPage1.PageViews.Add(pageView) | |
| AddTab("FileUpload", False) | |
| AddTab("TasksToFile", False) | |
| End If | |
| End Sub | |
| Private Sub AddTab(ByVal tabName As String, ByVal enabled As Boolean) | |
| Dim tab As New RadTab(tabName) | |
| tab.Enabled = enabled | |
| RadTabStrip1.Tabs.Add(tab) | |
| End Sub | |
| Protected Sub RadMultiPage1_PageViewCreated(ByVal sender As Object, ByVal e As RadMultiPageEventArgs) Handles RadMultiPage1.PageViewCreated | |
| Dim pageViewContents As Control = LoadControl(e.PageView.ID & ".ascx") | |
| pageViewContents.ID = e.PageView.ID & "userControl" | |
| e.PageView.Controls.Add(pageViewContents) | |
| End Sub | |
| End Class | |