Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a ASP.NET Expert!

Join 244,306 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 783 people online right now. Registration is fast and FREE... Join Now!




Wizard Control help

 
Reply to this topicStart new topic

Wizard Control help, dynamically creting wizard and saving each steps so that we can go pre

drvineeth
11 Nov, 2008 - 10:32 PM
Post #1

New D.I.C Head
*

Joined: 11 Nov, 2008
Posts: 2



Thanked: 1 times
My Contributions
csharp

public partial class Default3 : System.Web.UI.Page
{
SqlConnection cn = new SqlConnection("server=server;database=Jobrecrutement;uid=sa;password=sa");
SqlDataAdapter adp = new SqlDataAdapter();
DataSet ds = new DataSet();
SqlCommand cmd =new SqlCommand();
protected void Page_Load(object sender, EventArgs e)
{
Wizard WizardControl = new Wizard();
WizardControl.Height = Unit.Pixel(150);
WizardControl.Width = Unit.Pixel(300);
WizardControl.Style["Top"] = "111px";
WizardControl.Style["Left"] = "333px";
WizardControl.Style["Position"] = "absolute";
WizardControl.DisplaySideBar = false;

int j = Convert.ToInt16(Session["qno"]) - 1;
for (int i = 0; i <= j; i++)
{
WizardStepBase newStep = new WizardStep();
newStep.ID = "Step" + (i + 1).ToString();
WizardControl.WizardSteps.Add(newStep);
}

WizardControl.FinishButtonClick += new
WizardNavigationEventHandler(WizardControl_FinishButtonClick);


PlaceHolder1.Controls.Add(WizardControl);

cn.Open();
adp = new SqlDataAdapter("select * from questionpaper where qp_id='" + Session["qpid"].ToString() + "'", cn);
ds.Clear();
adp.Fill(ds);
cn.Close();


for (int i = 0; i < WizardControl.WizardSteps.Count; i++)
{
//Use a variable (ex. A in the code below)
//to tabulate the Image Control and
//RadioButtonList Control for each WizardStep.
//For example, WizardStep1 will
//contain Image1 and RadioButtonList1.
//WizardStep2 will contain Image2 and
//RadioButtonList2 and so on.

int A = i + 1;
Label Labelcontrol=new Label();
Labelcontrol.ID = "Label" + A.ToString();

Labelcontrol.Width = Unit.Pixel(200);
Labelcontrol.Height = Unit.Pixel(25);

WizardControl.WizardSteps[i].Controls.Add(Labelcontrol);

Labelcontrol.Text = ds.Tables[0].Rows[i].ItemArray[2].ToString();


RadioButtonList RadioButtonListControl = new RadioButtonList();
RadioButtonListControl.ID = "RadioButtonList" + A.ToString();
WizardControl.WizardSteps[i].Controls.Add(RadioButtonListControl);
RadioButtonList RBL = (RadioButtonList)
WizardControl.WizardSteps[i].FindControl(
"RadioButtonList" + A.ToString());
RBL.Width = Unit.Pixel(180);
RBL.Height = Unit.Pixel(100);
RBL.Items.Clear();

for (int x = 3; x < 7; x++)
{
RBL = (RadioButtonList)
WizardControl.WizardSteps[i].FindControl(
"RadioButtonList" + A.ToString());
RBL.Items.Add(new ListItem(
ds.Tables[0].Rows[i].ItemArray[x].ToString().Trim()));
}




}
}


iwant the remaining code to use next and previous so that previous page should be shown as it was.

Mod Edit: Please use code tags when posting your code. Code tags are used like so => code.gif

Thanks,
PsychoCoder smile.gif

User is offlineProfile CardPM
+Quote Post


PsychoCoder
RE: Wizard Control Help
12 Nov, 2008 - 02:37 AM
Post #2

loves.Coding(this);
Group Icon

Joined: 26 Jul, 2007
Posts: 12,288



Thanked: 372 times
Dream Kudos: 10775
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

My Contributions
Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:

  • Post the code you're having problems with (DONE)
  • Post the exact error you're receiving, if you are receiving one
  • If no error explain what the code is doing versus what you want it to do
  • Post your question in the body of your post, not the description field

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 06:41PM

Live ASP.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

ASP.NET Tutorials

Reference Sheets

ASP.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month