I'm trying to get an objectdatasource to bind data to 2(to start) different listboxes. The selectmethod is the same but the parameter values are different and are determined by the listbox being populated.
I'd prefer that as much coding be in the code behind file(C#).
Right now i can get the objectdatasource to populate both listboxes, but when one listbox is populated the other gets the same data. I want it to retain the data that it already had. the objectdatasource should only populate one listbox.
objectdatasource
code behind:
I'd prefer that as much coding be in the code behind file(C#).
Right now i can get the objectdatasource to populate both listboxes, but when one listbox is populated the other gets the same data. I want it to retain the data that it already had. the objectdatasource should only populate one listbox.
objectdatasource
Code:
<asp:ObjectDataSource ID="ObjectDataSource2" TypeName="dataType" runat="server" > </asp:ObjectDataSource>
code behind:
Code:
if (!listb.Visible)
{
switch (clicked.ID.ToString())
{
case "btnAdd":
ObjectDataSource2.SelectParameters["arg1"].DefaultValue="data1";
ObjectDataSource2.SelectParameters["arg2"].DefaultValue = "data2";
ObjectDataSource2.SelectParameters["arg3"].DefaultValue = "data3";
break;
case "btnAddTeam":
ObjectDataSource2.SelectParameters["arg1"].DefaultValue = "data1";
ObjectDataSource2.SelectParameters["arg2"].DefaultValue ="data2";
ObjectDataSource2.SelectParameters["arg3"].DefaultValue = "data3";
break;
}
clicked.Text = DONE;
listb.Visible = true;
}