i have 2 pages reg.aspx and home.aspx where in home.aspx page i have reg and signin link buttons and reg.aspx has a wizard control(consists of registration form, login form and forgot password form).

when i click on signin button it has to redirect to reg.aspx and in the wizard control step to has to be displayed. similarly with the register button.

i am trying to use previouspage property but i am getting error
System.NullReferenceException: Object reference not set to an instance of an object

please help me out.

thanks in advance

Hi

You should post some of your code, you're refering to an object that the code does not know exists or understands. Posting code samples inside the "CODE" "/CODE" tags will help others see what you are doing and maybe identify where it is going wrong. Have you tried going through the code in a step by step debug?

You are contributing the following post:
reg.aspx

<asp:Wizard ID="Wizard1" runat="server" CancelButtonText="" CancelButtonType="Link"
DisplaySideBar="False" FinishCompleteButtonText="" FinishCompleteButtonType="Link"
FinishPreviousButtonText="" FinishPreviousButtonType="Link" StartNextButtonText=""
StartNextButtonType="Link" StepNextButtonText="" StepNextButtonType="Link" StepPreviousButtonText=""
StepPreviousButtonType="Link"
Style="width: 100%; vertical-align: top; text-align: center;" Visible="False"
Width="1000px" ActiveStepIndex="0">
<WizardSteps>
<asp:WizardStep ID="WizardStep1" runat="server" Title="Registration">
&nbsp;
<table align="center" cellpadding="0" cellspacing="0" style="width: 700px">
<tr>
<td>
<table align="center" style="width: 600px">
<tr>
<td colspan="3" align="left">
<asp:Label ID="Label12" runat="server" BackColor="#999999" Font-Bold="True"
Font-Names="Calibri" ForeColor="White" Text="LOGIN DETAILS"></asp:Label>
</td>

</tr>
<tr>
<td align="right" width="200">
<asp:Label ID="Label13" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="UserName" Width="150px"></asp:Label>
</td>
<td width="15">
<strong>:</strong></td>
<td align="left" width="400">
<asp:TextBox ID="TextBox1" runat="server" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="Label14" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="Password" Width="150px"></asp:Label>
</td>
<td style="width: 14px">
<strong>:</strong></td>
<td align="left">
<asp:TextBox ID="TextBox2" runat="server" Width="200px" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="Label15" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="Confirm Password" Width="150px"></asp:Label>
</td>
<td style="width: 14px">
<strong>:</strong></td>
<td align="left">
<asp:TextBox ID="TextBox3" runat="server" Width="200px" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td align="left" colspan="3">
<asp:Label ID="Label16" runat="server" BackColor="Gray" Font-Bold="True"
Font-Names="Calibri" ForeColor="White" Text="PERSONAL INFORMATION"></asp:Label>
</td>

</tr>
<tr>
<td align="right">
<asp:Label ID="Label17" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="First Name" Width="150px"></asp:Label>
</td>
<td style="width: 14px">
<strong>:</strong></td>
<td align="left">
<asp:TextBox ID="TextBox4" runat="server" Width="200px"></asp:TextBox>
<asp:Label ID="Label18" runat="server" Font-Bold="True" Font-Names="Calibri"
Font-Size="Small" ForeColor="Red" Text="( As Per Passport )"></asp:Label>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="Label19" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="Middle Name" Width="150px"></asp:Label>
</td>
<td style="width: 14px">
<strong>:</strong></td>
<td align="left">
<asp:TextBox ID="TextBox5" runat="server" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="Label20" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="Last Name" Width="150px"></asp:Label>
</td>
<td style="width: 14px">
<strong>:</strong></td>
<td align="left">
<asp:TextBox ID="TextBox6" runat="server" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="Label23" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="Gender" Width="150px"></asp:Label>
</td>
<td style="width: 14px">
<strong>:</strong></td>
<td align="left">
<asp:RadioButtonList ID="RadioButtonList1" runat="server" Font-Bold="True"
Font-Names="Calibri" Width="200px">
<asp:ListItem>Female</asp:ListItem>
<asp:ListItem>Male</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="Label21" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="Address" Width="150px"></asp:Label>
</td>
<td style="width: 14px">
<strong>:</strong></td>
<td align="left">
<asp:TextBox ID="TextBox7" runat="server" TextMode="MultiLine" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="Label22" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="Email Id" Width="150px"></asp:Label>
</td>
<td style="width: 14px">
<strong>:</strong></td>
<td align="left">
<asp:TextBox ID="TextBox8" runat="server" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="Label24" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="Phone No" Width="150px"></asp:Label>
</td>
<td style="width: 14px">
<strong>:</strong></td>
<td align="left">
<asp:TextBox ID="TextBox9" runat="server" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td align="right">
<asp:Label ID="Label25" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="Purpose" Width="150px"></asp:Label>
</td>
<td style="width: 14px">
<strong>:</strong></td>
<td align="left">
<aspropDownList ID="DropDownList1" runat="server" Font-Bold="True"
Font-Names="Calibri" Width="200px">
<asp:ListItem>- Select -</asp:ListItem>
<asp:ListItem>Admissions</asp:ListItem>
<asp:ListItem>Training</asp:ListItem>
<asp:ListItem>Careers</asp:ListItem>
<asp:ListItem>Company Employer</asp:ListItem>
</aspropDownList>
</td>
</tr>
<tr>
<td align="right">
<asp:Button ID="Button4" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="SUBMIT" />
</td>
<td style="width: 14px">
&nbsp;</td>
<td align="left">
<asp:Button ID="Button5" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="CANCEL" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep2" runat="server" Title="Forgot Password">
<table align="center" cellpadding="0" cellspacing="0" style="width: 700px">
<tr>
<td>
&nbsp;</td>
<td>
<aspasswordRecovery ID="PasswordRecovery1" runat="server">
</aspasswordRecovery>
</td>
<td>
&nbsp;</td>
</tr>
</table>
</asp:WizardStep>
<asp:WizardStep ID="WizardStep3" runat="server" Title="Login">
<table border="0" cellpadding="0" cellspacing="0" style="height: 127px;"
width="250">
<tr>
<td align="center" class="style2" colspan="4">
&nbsp;</td>
</tr>
<tr>
<td align="center" class="style2" colspan="4">
&nbsp;
<asp:Label ID="Label5" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="Login" Width="175px"></asp:Label>
</td>
</tr>
<tr>
<td align="right" class="style2" colspan="2" width="75">
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="UserName" Width="75px"></asp:Label>
</td>
<td width="10">
<b style="width: 10px">:</b>&nbsp;
</td>
<td width="165">
<asp:TextBox ID="uname_txt" runat="server" Font-Names="Comic Sans MS"
Width="100px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="uname_txt" ErrorMessage="Enter UserName" Font-Bold="True"
Font-Names="Calibri" Font-Size="XX-Small" Width="65px" ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right" class="style2" colspan="2">
<asp:Label ID="Label2" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="Password"></asp:Label>
</td>
<td>
<b>:</b></td>
<td>
<asp:TextBox ID="pwd_txt" runat="server" Font-Names="Comic Sans MS"
TextMode="Password" Width="100px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="pwd_txt" ErrorMessage="Enter Password" Font-Bold="True"
Font-Names="Calibri" Font-Size="XX-Small" Width="65px" ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="right" class="style2" colspan="2">
&nbsp;
</td>
<td>
&nbsp;
</td>
<td>
&nbsp;
</td>
</tr>
<tr>
<td class="style2">
&nbsp;
</td>
<td class="style2" width="70">
<asp:Button ID="Button1" runat="server" Font-Bold="True" Font-Names="Calibri"
Text="SIGN IN" Width="70px" />
</td>
<td class="style2">
&nbsp;</td>
<td>
<asp:Button ID="Button3" runat="server" Font-Bold="True" Font-Names="Calibri"
PostBackUrl="~/Registration.aspx" Text="REGISTER" />
</td>
</tr>
<tr>
<td align="center" class="style2" colspan="4">
<asp:HyperLink ID="HyperLink1" runat="server" Font-Bold="False"
Font-Names="Calibri" ForeColor="Red">Forgot Password ?</asp:HyperLink>
</td>
</tr>
<tr>
<td align="left" class="style2" colspan="4">
&nbsp;</td>
</tr>
</table>
<br />
</asp:WizardStep>

</WizardSteps>
</asp:Wizard>

home.aspx

<%@ Page Title="" Language="VB" MasterPageFile="~/site.master" AutoEventWireup="false" CodeFile="Home1.aspx.vb" Inherits="Home1" %>
<%@ PreviousPageType VirtualPath="reg.aspx" %>


<asp:Content ID="Content1" ContentPlaceHolderID="cp3" Runat="Server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cp2" Runat="Server">
<table align="left" cellpadding="0" cellspacing="0" class="style3" width="1000">

<tr>
<td align="right">
&nbsp;</td>
<td>&nbsp;</td>
<td width="100">&nbsp;</td>
<td align="center" width="100">&nbsp;</td>
<td align="center" width="100">&nbsp;</td>
</tr>

<tr>
<td align="right">
</td>
<td></td>
<td height="25" width="100"></td>
<td align="center" height="20"
style="background-image: url('Images/gallerybuttons_21.jpg'); background-repeat: no-repeat"
width="100">
<asp:LinkButton ID="btn_signin" runat="server" Font-Bold="True"
Font-Names="Calibri" Font-Size="Medium" Font-Underline="False"
ForeColor="White" PostBackUrl="~/Registration.aspx">Sign In</asp:LinkButton>
</td>
<td align="center"
style="background-image: url('Images/gallerybuttons_21.jpg'); background-repeat: no-repeat"
width="100">
<asp:LinkButton ID="btn_register" runat="server" Font-Bold="True"
Font-Names="Calibri" Font-Underline="False" ForeColor="White"
PostBackUrl="~/Registration.aspx">Register</asp:LinkButton>
</td>
</tr>
<tr>
<td class="style4">&nbsp;
</td>
<td align="left" valign="middle">
<asp:Image ID="Image3" runat="server" Height="30px"
ImageUrl="~/Images/ourcompany.gif" Width="250px" />
</td>
<td>&nbsp;</td>
</tr>
<tr>
<td class="style4" width="200">
&nbsp;</td>
<td colspan="2" rowspan="2">
<asp:Label ID="Label8" runat="server" Font-Names="Calibri"

Text="<p>Edutech Systems, Inc. is dedicated to providing its customers with the best possible service in selecting universities, training, recruiting and hiring them to fulfill the customer needs.</p><p>Our recruiting experts understand the intricacies of a correct match, and make sure each candidate fits the needs, expectations, and company culture.</p><p>We are in tune with the current needs of the market and have the expertise to technically screen our candidates to acquire the right jobs in the corporate market.</p>"
Width="550px" ForeColor="White"></asp:Label>
</td>
</tr>
<tr>
<td height="100" class="style4">&nbsp;
</td>
</tr>
</table>
</asp:Content>

home.vb

Public Sub btn_signin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_signin.Click


Dim wz1 As New Wizard
wz1 = PreviousPage.FindControl("Wizard1")
wz1.Visible = True
wz1.ActiveStepIndex = 2



End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.