Click here to Skip to main content
15,891,976 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Play music in web page Pin
Sun Rays26-Nov-07 18:42
Sun Rays26-Nov-07 18:42 
AnswerRe: Play music in web page Pin
Vasudevan Deepak Kumar26-Nov-07 20:37
Vasudevan Deepak Kumar26-Nov-07 20:37 
QuestionWebconfig session state settings..., [modified] Pin
Member 387988126-Nov-07 17:02
Member 387988126-Nov-07 17:02 
QuestionAsp.net 2.0 Menu Control Pin
Lijo Rajan26-Nov-07 16:58
Lijo Rajan26-Nov-07 16:58 
Questionmodify xml using freetextbox Pin
srinivas43126-Nov-07 16:38
srinivas43126-Nov-07 16:38 
QuestionHelp Pin
cisco210326-Nov-07 15:12
cisco210326-Nov-07 15:12 
AnswerRe: Help Pin
Sherin Iranimose26-Nov-07 17:48
Sherin Iranimose26-Nov-07 17:48 
Questionproblems casting an object to a listbox Pin
foobarDividedByZero26-Nov-07 11:28
foobarDividedByZero26-Nov-07 11:28 
Hi,
I have a series of pages to create that will each have a bunch of listboxes on them, each containing a listing of files in a directory. I'm trying to get the page down to basics where i only have to plug in the correct paths to the folders, but I'm hitting a problem casting 'object sender' to a listbox - the SelectedItem is always the first item, not what was actually selected.

here is the entire code-behind (stripped down to basics):
public partial class departments_safety_play : System.Web.UI.Page {
private static readonly string year = DateTime.Now.Year.ToString();
private static readonly string root = @"../..//FIBRELINE/";
private readonly string pathFibrelineA = string.Format(@"{0}{1}/A-SHIFT/", root, year);

protected void Page_Load(object sender, EventArgs e) {
if (!IsPostBack) {
string folderToBrowse = Server.MapPath(pathFibrelineA);
utilityLib.ShowFilesInWithValue(folderToBrowse, lstFibrelineA, pathFibrelineA);
}
}

protected void lbSelectedIndexChanged(ListBox lb) {
string dir = lb.SelectedValue + lb.SelectedItem.Text;
string popupScript = "" +
"window.open('" + dir + "', 'CustomPopUp', " +
"'width=600, height=500, menubar=1, resizable=1, location=1')" +
"";
ClientScript.RegisterStartupScript(GetType(), lb.SelectedItem.Text, popupScript);
}

protected void SelectedIndexChanged(object sender, EventArgs e) {
ListBox lb = (ListBox) sender;
lbSelectedIndexChanged(lb);
}
}
QuestionLoop Through Database Pin
kenexcelon26-Nov-07 9:07
kenexcelon26-Nov-07 9:07 
AnswerRe: Loop Through Database Pin
kenexcelon26-Nov-07 9:51
kenexcelon26-Nov-07 9:51 
GeneralRe: Loop Through Database Pin
John-ph26-Nov-07 20:52
John-ph26-Nov-07 20:52 
QuestionAJAX install question Pin
amatbrewer26-Nov-07 8:11
amatbrewer26-Nov-07 8:11 
AnswerRe: AJAX install question Pin
amatbrewer26-Nov-07 9:39
amatbrewer26-Nov-07 9:39 
QuestionHandling web service exceptions Pin
dubbele onzin26-Nov-07 6:42
dubbele onzin26-Nov-07 6:42 
QuestionUsing Session Variable in Javascript Method. Pin
M_Menon26-Nov-07 5:55
M_Menon26-Nov-07 5:55 
AnswerRe: Using Session Variable in Javascript Method. Pin
SABhatti26-Nov-07 6:10
SABhatti26-Nov-07 6:10 
GeneralRe: Using Session Variable in Javascript Method. Pin
M_Menon26-Nov-07 7:00
M_Menon26-Nov-07 7:00 
AnswerRe: Using Session Variable in Javascript Method. Pin
SABhatti26-Nov-07 8:04
SABhatti26-Nov-07 8:04 
QuestionReading a multiline TextBox Pin
NetBot26-Nov-07 5:27
NetBot26-Nov-07 5:27 
AnswerRe: Reading a multiline TextBox Pin
SABhatti26-Nov-07 5:58
SABhatti26-Nov-07 5:58 
Questionencrypt strings within web.config Pin
gsshaw26-Nov-07 4:39
gsshaw26-Nov-07 4:39 
AnswerRe: encrypt strings within web.config Pin
Michael Sync26-Nov-07 4:59
Michael Sync26-Nov-07 4:59 
AnswerRe: encrypt strings within web.config Pin
SABhatti26-Nov-07 5:01
SABhatti26-Nov-07 5:01 
General3 for 3 ! Pin
gsshaw26-Nov-07 5:13
gsshaw26-Nov-07 5:13 
Questionposting to confirmation page Pin
gsshaw26-Nov-07 4:29
gsshaw26-Nov-07 4:29 

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.