Solved

pass checkboxlist selected values through ObjectDataSource to public class function

Posted on 2011-03-15
2
1,854 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create a Distribution Group 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 Recipients >>…
how to add IIS SMTP to handle application/Scanner relays into office 365.

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now