[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

asp.net c# wizard and usercontrol not working

Posted on 2009-07-09
1
Medium Priority
?
422 Views
Last Modified: 2013-11-25
check attached code. I just can not find why Response.Write(principalname.ToString()); has nothing to be shown.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register src="PrincipalControl.ascx" tagname="PrincipalControl" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:Wizard ID="Wizard1" runat="server" Height="269px" Width="474px" 
            ActiveStepIndex="1" onfinishbuttonclick="Wizard1_NextButtonClick">
            <WizardSteps>
                <asp:WizardStep runat="server" title="Step 1">
                <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
                </asp:WizardStep>
                <asp:WizardStep runat="server" title="Step 2">
                <asp:PlaceHolder ID="PlaceHolder2" runat="server"></asp:PlaceHolder>
             </asp:WizardStep>
            </WizardSteps>
        </asp:Wizard>
    
    </div>
    </form>
</body>
</html>
 
 
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        PrincipalControl newprincipal = (PrincipalControl)LoadControl("PrincipalControl.ascx");
        PlaceHolder1.Controls.Add(newprincipal);
    }
 
    protected void Wizard1_NextButtonClick(object sender, WizardNavigationEventArgs e)
    {
       if (Wizard1.WizardSteps[e.NextStepIndex].StepType == WizardStepType.Finish)
        {
            for (int i = 0; i < PlaceHolder1.Controls.Count; i++)
            {
                PrincipalControl newprincipalinfo = (PrincipalControl)PlaceHolder1.Controls[i];
                string principalname = newprincipalinfo.principalname;
                Response.Write(principalname.ToString());
            }
        }
    }
 
}

Open in new window

0
Comment
Question by:Webboy2008
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 41

Accepted Solution

by:
guru_sami earned 2000 total points
ID: 24819694
I doubt the value for principalname property is not set in your usercontrol...
Can you share the PrincipalControl UC control code?
Set breakpoints and see if the property value is getting set....before you are trying to access it.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question