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

ASP.NET

 
QuestionDrop down list not populating [modified] Pin
leckey10-Jul-06 9:35
leckey10-Jul-06 9:35 
I have a drop down list (not attached to my datagrid anymore for those of you on the saga with me). I just want to populate this plain old drop-down box. But I can't get it to populate. I could get it to populate when I had it inside a datagrid, so I'm sure it's something easy.

Here is my asp code:
<asp:dropdownlist id=ddPartType style="Z-INDEX: 101; LEFT: 104px; POSITION: absolute; TOP: 48px" tabIndex=1 runat="server" Width="144px" Height="24px" DataSource="<%# GetPartTypes()%>" DataTextField="ptDescription" DataValueField="ptId" EnableViewState="True" AutoPostBack="True"><br />
			</asp:dropdownlist>


All I'm doing is calling GetPartTypes. Okay, here's that code (C#)
public DataSet GetPartTypes()<br />
		{<br />
			ds3 = new DataSet();<br />
			ds3= SqlHelper.ExecuteDataset(this.connectionString, "dbo.GetDescriptions", null);	<br />
			dt3 = ds3.Tables[0];<br />
			ds3.Tables[0].TableName="PartTypes";<br />
			ddPartType.DataSource = ds3;<br />
			ddPartType.DataBind();<br />
			return ds3;<br />
<br />
		}


This calls a stored procedure, GetDescriptions. I know this code works because it executes in Query Analyzer. It's just basically return the descriptions and order by description.

Going through the debugger it's like the code never gets called. So I delibrately called it in PageLoad and got a stack overflow.

BLECH!

Follow up: Okay I can get it to populate if I put the code in the PageLoad. Is this the only way to do it? Or is there something similiar to what I was trying to do?

-- modified at 16:09 Monday 10th July, 2006
AnswerRe: Drop down list not populating Pin
Not Active10-Jul-06 11:51
mentorNot Active10-Jul-06 11:51 
AnswerRe: Drop down list not populating Pin
postmaster@programmingknowledge.com10-Jul-06 17:47
postmaster@programmingknowledge.com10-Jul-06 17:47 
QuestionUse of query strings Pin
leckey10-Jul-06 5:55
leckey10-Jul-06 5:55 
AnswerRe: Use of query strings Pin
Paddy Boyd10-Jul-06 6:06
Paddy Boyd10-Jul-06 6:06 
GeneralRe: Use of query strings Pin
leckey10-Jul-06 6:10
leckey10-Jul-06 6:10 
GeneralRe: Use of query strings Pin
Paddy Boyd10-Jul-06 6:11
Paddy Boyd10-Jul-06 6:11 
GeneralRe: Use of query strings Pin
leckey10-Jul-06 7:04
leckey10-Jul-06 7:04 
GeneralRe: Use of query strings Pin
eggsovereasy10-Jul-06 7:21
eggsovereasy10-Jul-06 7:21 
GeneralRe: Use of query strings Pin
eggsovereasy10-Jul-06 7:23
eggsovereasy10-Jul-06 7:23 
GeneralRe: Use of query strings [modified] Pin
leckey10-Jul-06 7:46
leckey10-Jul-06 7:46 
QuestionScrolling Issue in component Art grid Pin
MaheshSharma10-Jul-06 5:40
MaheshSharma10-Jul-06 5:40 
Questionneed help with server address? used on my webpage Pin
keroed_edmond10-Jul-06 5:29
keroed_edmond10-Jul-06 5:29 
AnswerRe: need help with server address? used on my webpage Pin
eggsovereasy10-Jul-06 7:24
eggsovereasy10-Jul-06 7:24 
GeneralRe: need help with server address? used on my webpage Pin
keroed_edmond10-Jul-06 8:25
keroed_edmond10-Jul-06 8:25 
GeneralRe: need help with server address? used on my webpage Pin
eggsovereasy10-Jul-06 8:56
eggsovereasy10-Jul-06 8:56 
GeneralRe: need help with server address? used on my webpage Pin
keroed_edmond10-Jul-06 9:16
keroed_edmond10-Jul-06 9:16 
AnswerRe: need help with server address? used on my webpage Pin
Guffa10-Jul-06 7:39
Guffa10-Jul-06 7:39 
GeneralRe: need help with server address? used on my webpage Pin
keroed_edmond10-Jul-06 8:26
keroed_edmond10-Jul-06 8:26 
AnswerRe: need help with server address? used on my webpage Pin
Guffa10-Jul-06 9:22
Guffa10-Jul-06 9:22 
QuestionASP.net timeout Pin
rahul7710-Jul-06 4:18
rahul7710-Jul-06 4:18 
AnswerRe: ASP.net timeout Pin
Not Active10-Jul-06 5:35
mentorNot Active10-Jul-06 5:35 
QuestionAtlas and browser problem Pin
Tridip Bhattacharjee10-Jul-06 3:32
professionalTridip Bhattacharjee10-Jul-06 3:32 
AnswerRe: Atlas and browser problem Pin
RichardGrimmer11-Jul-06 5:13
RichardGrimmer11-Jul-06 5:13 
QuestionRead URL from an Internet Shortcut file Pin
Subrahmanyam K10-Jul-06 2:52
Subrahmanyam K10-Jul-06 2:52 

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.