switch value with button in the page (below failig test code).
I know in this test case I could create an extra variable and use it, my
problem is the switch, i my real problem is in a repeater, hence I cannot
use a property!
how to change the label of the galador:Switch?
----------
<script runat="server">
void OnSwapSwitch(object sender, EventArgs e)
{
switch (mySwitch.Value)
{
case "0":
mySwitch.Value = "1";
break;
default:
mySwitch.Value = "0";
break;
}
}
</script
<galador:Switch id=mySwitch runat=server Value=1
<galador:SwitchCase runat=server label=0>
Azerty
<asp:LinkButton ID="LinkButton1" Runat=server
OnClick=OnSwapSwitch >Clic
Clac</asp:LinkButton>
</galador:SwitchCase
<galador:SwitchCase runat=server label=1>
Qwerty
<asp:LinkButton ID="LinkButton2" Runat=server
OnClick=OnSwapSwitch >Kodak</asp:LinkButton>
</galador:SwitchCase
</galador:SwitchHave you tried to databind your value to some variable? For example, when
you switch, in your back-end code, if you set some variable ( string MyVar =
"";), then do a Page.DataBind(), then you can access it in your ascx/aspx
code using something like this... <galador:SwitchCase runat=server
label="<%= MyVar %>"
Would that work for you?
--
Alex
"Lloyd Dupont" <ld@.NewsAccount.galador.net> wrote in message
news:uxC$yS%23wEHA.3416@.TK2MSFTNGP09.phx.gbl...
> I try to create a switch control, but I'm hitting a problem, changing the
> switch value with button in the page (below failig test code).
> I know in this test case I could create an extra variable and use it, my
> problem is the switch, i my real problem is in a repeater, hence I cannot
> use a property!
> how to change the label of the galador:Switch?
> ----------
> <script runat="server">
> void OnSwapSwitch(object sender, EventArgs e)
> {
> switch (mySwitch.Value)
> {
> case "0":
> mySwitch.Value = "1";
> break;
> default:
> mySwitch.Value = "0";
> break;
> }
> }
> </script>
> <galador:Switch id=mySwitch runat=server Value=1 >
> <galador:SwitchCase runat=server label=0>
> Azerty
> <asp:LinkButton ID="LinkButton1" Runat=server
> OnClick=OnSwapSwitch >Clic
> Clac</asp:LinkButton>
> </galador:SwitchCase>
> <galador:SwitchCase runat=server label=1>
> Qwerty
> <asp:LinkButton ID="LinkButton2" Runat=server
> OnClick=OnSwapSwitch >Kodak</asp:LinkButton>
> </galador:SwitchCase>
> </galador:Switch>
well, I guess I will have too...
but what I wonder is, my switch is in a repeater, how could I store the
value in a variable?
"Alex" <Alex@.donotemailme.com> wrote in message
news:uE1nVCGxEHA.1984@.TK2MSFTNGP14.phx.gbl...
> Have you tried to databind your value to some variable? For example, when
> you switch, in your back-end code, if you set some variable ( string MyVar
> =
> "";), then do a Page.DataBind(), then you can access it in your ascx/aspx
> code using something like this... <galador:SwitchCase runat=server
> label="<%= MyVar %>">
> Would that work for you?
> --
> Alex
> "Lloyd Dupont" <ld@.NewsAccount.galador.net> wrote in message
> news:uxC$yS%23wEHA.3416@.TK2MSFTNGP09.phx.gbl...
>> I try to create a switch control, but I'm hitting a problem, changing the
>> switch value with button in the page (below failig test code).
>>
>> I know in this test case I could create an extra variable and use it, my
>> problem is the switch, i my real problem is in a repeater, hence I cannot
>> use a property!
>>
>> how to change the label of the galador:Switch?
>> ----------
>> <script runat="server">
>> void OnSwapSwitch(object sender, EventArgs e)
>> {
>> switch (mySwitch.Value)
>> {
>> case "0":
>> mySwitch.Value = "1";
>> break;
>> default:
>> mySwitch.Value = "0";
>> break;
>> }
>> }
>> </script>
>>
>> <galador:Switch id=mySwitch runat=server Value=1 >
>>
>> <galador:SwitchCase runat=server label=0>
>> Azerty
>> <asp:LinkButton ID="LinkButton1" Runat=server
>> OnClick=OnSwapSwitch >Clic
>> Clac</asp:LinkButton>
>> </galador:SwitchCase>
>>
>> <galador:SwitchCase runat=server label=1>
>> Qwerty
>> <asp:LinkButton ID="LinkButton2" Runat=server
>> OnClick=OnSwapSwitch >Kodak</asp:LinkButton>
>> </galador:SwitchCase>
>>
>> </galador:Switch>
>>
>>
0 comments:
Post a Comment