Click here to Skip to main content
15,906,455 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Rendered HTML output Pin
DavidNohejl18-Jun-07 1:19
DavidNohejl18-Jun-07 1:19 
AnswerRe: Rendered HTML output Pin
moon_stick18-Jun-07 3:20
moon_stick18-Jun-07 3:20 
QuestionSession Problems Pin
Russell Jones18-Jun-07 0:14
Russell Jones18-Jun-07 0:14 
QuestionCoudl not get ListBox Value Pin
J Liang18-Jun-07 0:02
J Liang18-Jun-07 0:02 
AnswerRe: Coudl not get ListBox Value [modified] Pin
RepliCrux18-Jun-07 1:25
RepliCrux18-Jun-07 1:25 
GeneralRe: Coudl not get ListBox Value Pin
J Liang18-Jun-07 15:05
J Liang18-Jun-07 15:05 
AnswerRe: Coudl not get ListBox Value Pin
RepliCrux18-Jun-07 15:16
RepliCrux18-Jun-07 15:16 
GeneralRe: Coudl not get ListBox Value Pin
J Liang18-Jun-07 17:29
J Liang18-Jun-07 17:29 
Hi RepliCrux,

Actually I got the function code from Mankayarkarasi (http://www.codeproject.com/aspnet/MCEnhancedListBoxControl.asp[^]

It is like this:

private void AddRemoveItem(ListBox aSource, ListBox aTarget)
{
ListItemCollection licCollection;

try
{
licCollection = new ListItemCollection();

for (int intCount = 0; intCount < aSource.Items.Count; intCount++)
{
if (aSource.Items[intCount].Selected == true)
{
licCollection.Add(aSource.Items[intCount]);
}
}
for (int intCount = 0; intCount < licCollection.Count; intCount++)
{
aSource.Items.Remove(licCollection[intCount]);
aTarget.Items.Add(licCollection[intCount]);
}


}
catch (Exception expException)
{
this.jscript.MsgBox(expException.Message);
}
finally
{
licCollection = null;
}
}
Then from the button to populate, I do this:

protected void btnAssignOne_Click(object sender, EventArgs e)
{
//lstFromUser and lstToUser is ListItem from the listbox
this.AddRemoveItem(this.lstFromUser, this.lstToUser);
}

Then when I click another button, it suppose to gather all the IDs from this.lstToUser and that's where it doesn't work for me.

I suspect the ID did transfer to the this.lstToUser. When I do this.lstToUser.SelectedValue.ToString(), I could get the ID but only the first one. I thought of using this.lstToUser.SelectedValue[0].ToString() but it was not the correct way.

J Liang
GeneralRe: Coudl not get ListBox Value Pin
RepliCrux18-Jun-07 17:36
RepliCrux18-Jun-07 17:36 
GeneralRe: Coudl not get ListBox Value Pin
RepliCrux18-Jun-07 17:39
RepliCrux18-Jun-07 17:39 
GeneralRe: Coudl not get ListBox Value Pin
J Liang20-Jun-07 16:03
J Liang20-Jun-07 16:03 
Questiondialog box Pin
niki_nilu17-Jun-07 23:51
niki_nilu17-Jun-07 23:51 
AnswerRe: dialog box Pin
N a v a n e e t h17-Jun-07 23:56
N a v a n e e t h17-Jun-07 23:56 
GeneralRe: dialog box Pin
niki_nilu18-Jun-07 0:03
niki_nilu18-Jun-07 0:03 
GeneralRe: dialog box Pin
Revathij18-Jun-07 0:24
Revathij18-Jun-07 0:24 
GeneralRe: dialog box Pin
N a v a n e e t h18-Jun-07 0:27
N a v a n e e t h18-Jun-07 0:27 
GeneralRe: dialog box Pin
niki_nilu18-Jun-07 1:45
niki_nilu18-Jun-07 1:45 
GeneralRe: dialog box Pin
N a v a n e e t h18-Jun-07 17:49
N a v a n e e t h18-Jun-07 17:49 
QuestionRefreshing User Control Pin
wEb GuRu...17-Jun-07 23:19
wEb GuRu...17-Jun-07 23:19 
AnswerRe: Refreshing User Control Pin
N a v a n e e t h17-Jun-07 23:43
N a v a n e e t h17-Jun-07 23:43 
QuestionRe: Refreshing User Control Pin
wEb GuRu...17-Jun-07 23:47
wEb GuRu...17-Jun-07 23:47 
AnswerRe: Refreshing User Control Pin
N a v a n e e t h17-Jun-07 23:55
N a v a n e e t h17-Jun-07 23:55 
GeneralRe: Refreshing User Control Pin
wEb GuRu...18-Jun-07 0:07
wEb GuRu...18-Jun-07 0:07 
GeneralRe: Refreshing User Control Pin
N a v a n e e t h18-Jun-07 1:07
N a v a n e e t h18-Jun-07 1:07 
QuestionCurrent Password field(text box ) to be checked against the value stored in database Pin
Hemant Garg17-Jun-07 22:51
Hemant Garg17-Jun-07 22:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.