Access Web Form Control

Discussion in 'ASP .Net' started by chessitguy@yahoo.com, Jan 18, 2007.

  1. Guest

    I have a simple Wizard
    page.aspx
    <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" >
    <WizardSteps>
    <asp:WizardStep ID="WizardStep1" runat="server" Title="Main">

    <Acme:Main runat="server" id="MainWC" />

    </asp:WizardStep>
    </WizardSteps>
    </asp:Wizard>

    with a web control
    page.ascx
    <asp:DropDownList ID="CorrectionType" runat="server">
    <asp:ListItem Value="None" Selected=True>None</asp:ListItem>
    <asp:ListItem Value="Gift">Gift</asp:ListItem>
    <asp:ListItem Value="Membership">Membership</asp:ListItem>
    <asp:ListItem Value="Gift and Membership">Gift and
    Membership</asp:ListItem>
    </asp:DropDownList>


    I'm trying to set the "CorrectionType.Text" value equal to a
    code-behind file Session Variable.
    like
    page.aspx.cs
    Sesssion["CorrectionType"] = MainWC.CorrectionType.Text;

    Basically, trying to set the CorrectionType on a Web Control equal to a
    Session in the code-behind file.

    Oh, when I try this I get:

    'ASP.development_z1_forms_main_ascx.CorrectionType' is inaccessible due
    to its protection level..
    Thanks.
     
    , Jan 18, 2007
    #1
    1. Advertising

  2. Try something like this:

    DropDownList ddlCorrectionType =
    (DropDownList)MainWC.FindControl("CorrectionType");
    Session["CorrectionType"] = ddlCorrectionType.Text;

    Regards,
    Brian K. Williams



    <> wrote in message
    news:...
    >I have a simple Wizard
    > page.aspx
    > <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" >
    > <WizardSteps>
    > <asp:WizardStep ID="WizardStep1" runat="server" Title="Main">
    >
    > <Acme:Main runat="server" id="MainWC" />
    >
    > </asp:WizardStep>
    > </WizardSteps>
    > </asp:Wizard>
    >
    > with a web control
    > page.ascx
    > <asp:DropDownList ID="CorrectionType" runat="server">
    > <asp:ListItem Value="None" Selected=True>None</asp:ListItem>
    > <asp:ListItem Value="Gift">Gift</asp:ListItem>
    > <asp:ListItem Value="Membership">Membership</asp:ListItem>
    > <asp:ListItem Value="Gift and Membership">Gift and
    > Membership</asp:ListItem>
    > </asp:DropDownList>
    >
    >
    > I'm trying to set the "CorrectionType.Text" value equal to a
    > code-behind file Session Variable.
    > like
    > page.aspx.cs
    > Sesssion["CorrectionType"] = MainWC.CorrectionType.Text;
    >
    > Basically, trying to set the CorrectionType on a Web Control equal to a
    > Session in the code-behind file.
    >
    > Oh, when I try this I get:
    >
    > 'ASP.development_z1_forms_main_ascx.CorrectionType' is inaccessible due
    > to its protection level..
    > Thanks.
    >
     
    Brian Williams, Jan 18, 2007
    #2
    1. Advertising

  3. Guest

    You Rock! That worked. Is there an online resource that has more
    information on Web Control topics that you recommend?


    Thanks.
    vj

    Brian Williams wrote:
    > Try something like this:
    >
    > DropDownList ddlCorrectionType =
    > (DropDownList)MainWC.FindControl("CorrectionType");
    > Session["CorrectionType"] = ddlCorrectionType.Text;
    >
    > Regards,
    > Brian K. Williams
    >
    >
    >
    > <> wrote in message
    > news:...
    > >I have a simple Wizard
    > > page.aspx
    > > <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" >
    > > <WizardSteps>
    > > <asp:WizardStep ID="WizardStep1" runat="server" Title="Main">
    > >
    > > <Acme:Main runat="server" id="MainWC" />
    > >
    > > </asp:WizardStep>
    > > </WizardSteps>
    > > </asp:Wizard>
    > >
    > > with a web control
    > > page.ascx
    > > <asp:DropDownList ID="CorrectionType" runat="server">
    > > <asp:ListItem Value="None" Selected=True>None</asp:ListItem>
    > > <asp:ListItem Value="Gift">Gift</asp:ListItem>
    > > <asp:ListItem Value="Membership">Membership</asp:ListItem>
    > > <asp:ListItem Value="Gift and Membership">Gift and
    > > Membership</asp:ListItem>
    > > </asp:DropDownList>
    > >
    > >
    > > I'm trying to set the "CorrectionType.Text" value equal to a
    > > code-behind file Session Variable.
    > > like
    > > page.aspx.cs
    > > Sesssion["CorrectionType"] = MainWC.CorrectionType.Text;
    > >
    > > Basically, trying to set the CorrectionType on a Web Control equal to a
    > > Session in the code-behind file.
    > >
    > > Oh, when I try this I get:
    > >
    > > 'ASP.development_z1_forms_main_ascx.CorrectionType' is inaccessible due
    > > to its protection level..
    > > Thanks.
    > >
     
    , Jan 18, 2007
    #3
  4. My favorite place for code examples is http://www.codeproject.com or
    http://www.gotdotnet.com
    and don't forget about the newsgroup
    microsoft.public.dotnet.framework.aspnet.webcontrols.


    NP, glad I could help...
    Brian



    <> wrote in message
    news:...
    > You Rock! That worked. Is there an online resource that has more
    > information on Web Control topics that you recommend?
    >
    >
    > Thanks.
    > vj
    >
    > Brian Williams wrote:
    >> Try something like this:
    >>
    >> DropDownList ddlCorrectionType =
    >> (DropDownList)MainWC.FindControl("CorrectionType");
    >> Session["CorrectionType"] = ddlCorrectionType.Text;
    >>
    >> Regards,
    >> Brian K. Williams
    >>
    >>
    >>
    >> <> wrote in message
    >> news:...
    >> >I have a simple Wizard
    >> > page.aspx
    >> > <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" >
    >> > <WizardSteps>
    >> > <asp:WizardStep ID="WizardStep1" runat="server" Title="Main">
    >> >
    >> > <Acme:Main runat="server" id="MainWC" />
    >> >
    >> > </asp:WizardStep>
    >> > </WizardSteps>
    >> > </asp:Wizard>
    >> >
    >> > with a web control
    >> > page.ascx
    >> > <asp:DropDownList ID="CorrectionType" runat="server">
    >> > <asp:ListItem Value="None" Selected=True>None</asp:ListItem>
    >> > <asp:ListItem Value="Gift">Gift</asp:ListItem>
    >> > <asp:ListItem Value="Membership">Membership</asp:ListItem>
    >> > <asp:ListItem Value="Gift and Membership">Gift and
    >> > Membership</asp:ListItem>
    >> > </asp:DropDownList>
    >> >
    >> >
    >> > I'm trying to set the "CorrectionType.Text" value equal to a
    >> > code-behind file Session Variable.
    >> > like
    >> > page.aspx.cs
    >> > Sesssion["CorrectionType"] = MainWC.CorrectionType.Text;
    >> >
    >> > Basically, trying to set the CorrectionType on a Web Control equal to a
    >> > Session in the code-behind file.
    >> >
    >> > Oh, when I try this I get:
    >> >
    >> > 'ASP.development_z1_forms_main_ascx.CorrectionType' is inaccessible due
    >> > to its protection level..
    >> > Thanks.
    >> >

    >
     
    Brian Williams, Jan 19, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFz?=

    Access html control in Web form

    =?Utf-8?B?RGFz?=, May 11, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    465
    Eliyahu Goldin
    May 11, 2004
  2. Joachim Feldt
    Replies:
    2
    Views:
    689
    Matt Berther
    Nov 1, 2004
  3. =?Utf-8?B?UWFqdXNzaQ==?=

    How to create a web form like MS access form using asp.net??

    =?Utf-8?B?UWFqdXNzaQ==?=, Dec 27, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    751
    =?Utf-8?B?UWFqdXNzaQ==?=
    Dec 27, 2004
  4. xz
    Replies:
    9
    Views:
    536
    James Kanze
    Jan 8, 2008
  5. Hans Östlund
    Replies:
    1
    Views:
    177
    Alessandro Zifiglio
    Feb 5, 2004
Loading...

Share This Page