Click here to Skip to main content
15,920,111 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionProblem setting focus Pin
CrazyCoder261-Sep-08 20:36
CrazyCoder261-Sep-08 20:36 
AnswerRe: Problem setting focus Pin
Gamzun1-Sep-08 20:45
Gamzun1-Sep-08 20:45 
GeneralRe: Problem setting focus Pin
CrazyCoder261-Sep-08 20:47
CrazyCoder261-Sep-08 20:47 
GeneralRe: Problem setting focus Pin
Gamzun1-Sep-08 20:49
Gamzun1-Sep-08 20:49 
GeneralRe: Problem setting focus Pin
CrazyCoder261-Sep-08 20:50
CrazyCoder261-Sep-08 20:50 
GeneralRe: Problem setting focus Pin
Gamzun1-Sep-08 20:53
Gamzun1-Sep-08 20:53 
GeneralRe: Problem setting focus Pin
CrazyCoder261-Sep-08 20:55
CrazyCoder261-Sep-08 20:55 
QuestionError: The name 'ListBoxSites' does not exist in the current context Pin
PDTUM1-Sep-08 20:08
PDTUM1-Sep-08 20:08 
Gentleman,

I am trying to take the results of a query and insert them into a list box. In the code below, I have created an array called siteNumber by applying the query to a "for" loop. The idea was to then use a foreach loop to insert each of the items into a list box. HOWEVER, when I run the code, I get the following error:

Error: The name 'ListBoxSites' does not exist in the current context

Now, the ListBoxSites control freely appears in the intellisense, so I cannot understand the meaning of "does not exist"! I have used the identical format many times with desktop applications, but this is the first time I have ever used it with ASP. Is there a difference? I have posted the code below. Any assistance would be greatly appreciated.>>>Pat

int count = ds.Tables[0].Rows.Count;
string[] siteNumber = new string[count];
int i = 0;

for (i = 0; i < count; i++)
{
siteNumber[i] = ds.Tables[0].Rows[i]["SiteId"].ToString();
}

foreach (string number in siteNumber)
{
//Add to List Box
ListBoxSites.Items.Add(number);
}
AnswerRe: Error: The name 'ListBoxSites' does not exist in the current context Pin
Sandeep Akhare1-Sep-08 20:23
Sandeep Akhare1-Sep-08 20:23 
GeneralRe: Error: The name 'ListBoxSites' does not exist in the current context Pin
PDTUM2-Sep-08 8:19
PDTUM2-Sep-08 8:19 
QuestionTimeout Error in my Web Application Pin
VivekNema1-Sep-08 19:18
VivekNema1-Sep-08 19:18 
AnswerRe: Timeout Error in my Web Application Pin
Palli Rummi1-Sep-08 19:48
Palli Rummi1-Sep-08 19:48 
GeneralRe: Timeout Error in my Web Application Pin
VivekNema12-Sep-08 21:53
VivekNema12-Sep-08 21:53 
AnswerRe: Timeout Error in my Web Application Pin
Gamzun1-Sep-08 20:48
Gamzun1-Sep-08 20:48 
Questiondropdown list with checkboxs in Asp.net Pin
ncsubbu1-Sep-08 18:54
professionalncsubbu1-Sep-08 18:54 
AnswerRe: dropdown list with checkboxs in Asp.net Pin
Palli Rummi1-Sep-08 19:39
Palli Rummi1-Sep-08 19:39 
Questiondomain redirect Pin
Dpriya1-Sep-08 14:37
Dpriya1-Sep-08 14:37 
AnswerRe: domain redirect Pin
N a v a n e e t h1-Sep-08 17:43
N a v a n e e t h1-Sep-08 17:43 
QuestionPlease help me__ please................ Pin
Gjm1-Sep-08 13:29
Gjm1-Sep-08 13:29 
AnswerCP IGNORE IGNORE IGNORE!!!! Pin
leckey1-Sep-08 14:52
leckey1-Sep-08 14:52 
AnswerRe: Please help me__ please................ Pin
N a v a n e e t h1-Sep-08 17:47
N a v a n e e t h1-Sep-08 17:47 
GeneralRe: Please help me__ please................ Pin
Gjm2-Sep-08 15:40
Gjm2-Sep-08 15:40 
AnswerRe: Please help me__ please................ Pin
Paul Conrad3-Sep-08 13:33
professionalPaul Conrad3-Sep-08 13:33 
Question[CssClassProperty] not showing CssClass Selector in Property Grid Pin
Sunset Towers1-Sep-08 12:44
Sunset Towers1-Sep-08 12:44 
AnswerRe: [CssClassProperty] not showing CssClass Selector in Property Grid Pin
Sunset Towers1-Sep-08 23:59
Sunset Towers1-Sep-08 23:59 

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.