[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

dm_dal

2/17/2004 5:44:00 PM

Is this a known issue or something? During a postback, my CheckBoxList
controls forget which ListItems are Selected.

DMY


4 Answers

Teemu Keiski

2/17/2004 7:05:00 PM

0

Are you rebinding the list or adding items dynamically? Tell us more.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist


"dm_dal" <REMOVE_THIS.dmy75252@yahoo.com> wrote in message
news:uynBQ2X9DHA.2308@TK2MSFTNGP11.phx.gbl...
Is this a known issue or something? During a postback, my CheckBoxList
controls forget which ListItems are Selected.

DMY



dm_dal

2/17/2004 8:37:00 PM

0

The ListItems are added design time.

In the Page_Load section, enclosed within the if(!IsPostBack) is where I'm
setting the Selected property for each ListItem. Initially, the
CheckBoxList's enabled property is set to false, and when the user clicks
the edit button, this control et.al. are set to enabled. It's during this
postback that the ListItems lose their Selected state.


"Teemu Keiski" <joteke@aspalliance.com> wrote in message
news:OR4OzjY9DHA.1356@tk2msftngp13.phx.gbl...
> Are you rebinding the list or adding items dynamically? Tell us more.
>
> --
> Teemu Keiski
> MCP, Microsoft MVP (ASP.NET), AspInsiders member
> ASP.NET Forum Moderator, AspAlliance Columnist
>
>
> "dm_dal" <REMOVE_THIS.dmy75252@yahoo.com> wrote in message
> news:uynBQ2X9DHA.2308@TK2MSFTNGP11.phx.gbl...
> Is this a known issue or something? During a postback, my CheckBoxList
> controls forget which ListItems are Selected.
>
> DMY
>
>
>


Teemu Keiski

2/18/2004 9:29:00 PM

0

Hi,

that is due to the nature of <input type=checkbox> HTML elements that they
don't post their value when HTML element is disabled, causing selection to
be lost on postback (despite do you change the CheckBoxList to enabled or
not). .

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"dm_dal" <REMOVE_THIS.dmy75252@yahoo.com> wrote in message
news:%23%23nxbXZ9DHA.1632@TK2MSFTNGP12.phx.gbl...
The ListItems are added design time.

In the Page_Load section, enclosed within the if(!IsPostBack) is where I'm
setting the Selected property for each ListItem. Initially, the
CheckBoxList's enabled property is set to false, and when the user clicks
the edit button, this control et.al. are set to enabled. It's during this
postback that the ListItems lose their Selected state.


"Teemu Keiski" <joteke@aspalliance.com> wrote in message
news:OR4OzjY9DHA.1356@tk2msftngp13.phx.gbl...
> Are you rebinding the list or adding items dynamically? Tell us more.
>
> --
> Teemu Keiski
> MCP, Microsoft MVP (ASP.NET), AspInsiders member
> ASP.NET Forum Moderator, AspAlliance Columnist
>
>
> "dm_dal" <REMOVE_THIS.dmy75252@yahoo.com> wrote in message
> news:uynBQ2X9DHA.2308@TK2MSFTNGP11.phx.gbl...
> Is this a known issue or something? During a postback, my CheckBoxList
> controls forget which ListItems are Selected.
>
> DMY
>
>
>



Teemu Keiski

2/18/2004 9:37:00 PM

0

And to add that the behavior not to post value when INPUT element is
disabled is in the HTML standard. Basically setting the element to be
readonly could work, but not sure if it can be straightforward set to
singular items in CheckBoxlist (ListItem has Attributes property but it
doesn't seem to reflect added attributes what is known bug:
http://support.microsoft.com/default.aspx?scid=kb;en...).

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist




"dm_dal" <REMOVE_THIS.dmy75252@yahoo.com> wrote in message
news:%23%23nxbXZ9DHA.1632@TK2MSFTNGP12.phx.gbl...
The ListItems are added design time.

In the Page_Load section, enclosed within the if(!IsPostBack) is where I'm
setting the Selected property for each ListItem. Initially, the
CheckBoxList's enabled property is set to false, and when the user clicks
the edit button, this control et.al. are set to enabled. It's during this
postback that the ListItems lose their Selected state.


"Teemu Keiski" <joteke@aspalliance.com> wrote in message
news:OR4OzjY9DHA.1356@tk2msftngp13.phx.gbl...
> Are you rebinding the list or adding items dynamically? Tell us more.
>
> --
> Teemu Keiski
> MCP, Microsoft MVP (ASP.NET), AspInsiders member
> ASP.NET Forum Moderator, AspAlliance Columnist
>
>
> "dm_dal" <REMOVE_THIS.dmy75252@yahoo.com> wrote in message
> news:uynBQ2X9DHA.2308@TK2MSFTNGP11.phx.gbl...
> Is this a known issue or something? During a postback, my CheckBoxList
> controls forget which ListItems are Selected.
>
> DMY
>
>
>