Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > UserControl with databound repeater drops values on postback

Reply
Thread Tools

UserControl with databound repeater drops values on postback

 
 
paul.hester@gmail.com
Guest
Posts: n/a
 
      09-01-2006
Hi all,

I have a user control that contains a repeater that generates a list of
check boxes. The checkboxes render fine, but they don't maintain their
checked state on postback.

I've tried using Page_Load, Page_Init, OnInit, enabling and disabling
viewstate without success. Any help would be appreciated.

Thanks,

Paul

ASCX:

<asp:Repeater ID="countryList" runat="server">
<HeaderTemplate>
<table cellpadding="2" cellspacing="0">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td><asp:CheckBox ID="countryID" Value='<%# Eval("CountryID") %>'
runat="server" /></td>
<td><asp:Label AssociatedControlID="countryID" runat="server"><%#
Eval("Name") %></asp:Label></td>
<td><img src="<%# string.Format("/images/flags/{0}.gif",
Eval("CountryID")) %>" height="13" width="24" /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

ASCX.CS:

protected void Page_Init(object sender, EventArgs e)
{
// get countries
countryList.DataSource = Country.GetCountries();
DataBind();
}

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireless Connection Drops, then connects, drops... garywi Wireless Networking 1 02-12-2009 02:26 PM
databound custom controls vs composite databound custom controls rodchar ASP .Net 0 11-26-2007 03:51 PM
UserControl with databound repeater drops values on postback paul.hester@gmail.com ASP .Net Building Controls 3 09-02-2006 07:11 AM
UserControl with databound repeater drops values on postback Paul ASP .Net 0 09-01-2006 04:42 AM
templated databound control problem - not showing databound Manu ASP .Net Web Controls 0 05-22-2006 09:46 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57