If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Threaded View

Help or suggestion to build a list of values control

Hi all, Ill do my best to explain as best I can.

I'm trying to build a list of values from which a user can select either individual list items or multiple. (See attachments)
The control currently consists of a drop down list and an hyperlink. If the user is to select an individual item then it is simply a matter of binding the values to the drop down list and the hyperlink is disabled and not visible. However if the user may select multiple items you cannot do it with the conventional drop down list, it will be a list box. In this case the hyperlink is enabled and visible, when clicked on opens up a new window via javascript, the window opened is determined by the height and width set in the control tag. Usually only 350 x 250.

This window has two forms, the first has a text box and beside it a submit/search button, which I want to display if the control tag in the other window has the attribute Search set to true. Upon a user clicking the search button it fills the list box, which is in the second form, with values that match the criteria. The second form also has a submit button. The user will select these items as necessary and click the submit button this will send the select items back to the drop down list in the parent window and close the popup window.

The reason I'm doing it this way is to save space, as I will be having this control multiple times on the same page. I just need to find a way of getting the control attributes/properties to the popup without a huge ugly querystring, surely there has got to be a cleaner way to do this. Following is some of the code. I have also placed a couple of screen shots on my website http://geocities.com/illcomms/ these were done when I was using ASP and now wanting something similar in .Net.

Menu.aspx.cs (code behind)
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

private void Page_Load(object sender, System.EventArgs e)
{
// This is where I need to find out if Search is enabled
// on the control.
// one other thing that I will add later is the stored procedure which it is to call
if (Search == true)
{
//These are disabled by default
txtSearch.Visible = true;
txtSearch.Enabled = true;
btnSearch.Visible = true;
btnSearch.Enabled = true;
}
}
}
}