Solved

pass checkboxlist selected values through ObjectDataSource to public class function

Posted on 2011-03-15
2
1,946 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

Suggested Solutions

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.
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

738 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