Solved

pass checkboxlist selected values through ObjectDataSource to public class function

Posted on 2011-03-15
2
1,921 Views
Last Modified: 2012-05-11
Hi,

I'm having a bit of trouble finding a way to pass the selected values on a checkboxlist to a function in a public class.

all i want is to list the selected checkboxlist items. Can anyone help please?

thanks,

Sam
webform code:
    
    <asp:CheckBoxList ID="CheckBoxList1" runat="server">
        <asp:ListItem>item1</asp:ListItem>
        <asp:ListItem>item2</asp:ListItem>
        <asp:ListItem>item3</asp:ListItem>
    </asp:CheckBoxList>

<asp:ObjectDataSource ID="odsTest" runat="server" SelectMethod="PopulateGridview" 
        TypeName="Paging.Subwin" SortParameterName="sortExpr" 
        SelectCountMethod="SelectCount" EnablePaging="True">
    <SelectParameters>
<asp:ControlParameter ControlID="CheckBoxList1" 
            Name="WellContainmentString" PropertyName="SelectedValue" Type="String" /></SelectParameters>

    </asp:ObjectDataSource>

public class code:

namespace Paging
{
    public partial class Subwin
    {
        
        public IQueryable PopulateGridview(string WellContainmentString)
        {

list selected checkbox values here!
}
}
}

Open in new window

0
Comment
Question by:OTM
2 Comments
 
LVL 11

Accepted Solution

by:
Sudhakar Pulivarthi earned 500 total points
ID: 35148025
0
 

Author Closing Comment

by:OTM
ID: 35157335
the second link pointed me in the right direction, i ended up listing the selected items in a textbox with a ';', adding that as a string ControlParameter to the ObjectDataSource and splitting the string into an array at the other end.
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question