Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

pass checkboxlist selected values through ObjectDataSource to public class function

Posted on 2011-03-15
2
Medium Priority
?
2,006 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 2000 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
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 create a transport rule 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 Mail Flow >> Rules tab.:  To cr…

670 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