Simple dropdown question anyone?

Posted on 2005-04-27
Medium Priority
Last Modified: 2010-04-23
simple probelm,

have a calculator that worked when this line was like this  


<asp:TextBox id="term" runat="server"/>

but i now need a drop down not a txt box so i did this instead:


<asp:dropDownList id="term" runat="server">

i now get this error when before i did not have any i don't see whats wrong can anybody?

error ---------------------------------------------------------------------------------------

'Text' is not a member of 'System.Web.UI.WebControls.DropDownList'.

Line 9:  Dim d as Double = rate.Text
Line 10: Dim c as Double = amount.Text
Line 11: Dim n as Double = term.Text <---error on this line
Line 12: Dim p as Double
Line 13: Dim Cr as Double      

end of error -------------------------------------------------------------------------------

the name is the same nothing has changed is there something like term.DROPDOWN  that i should be using instead of text> as i have no idea.

many thanks if you can help

Question by:pigmentarts
  • 2
LVL 10

Accepted Solution

lengreen earned 2000 total points
ID: 13877576
Hi pigmentarts,


Dim n as Double = term.selectedItem.Text

LVL 12

Author Comment

ID: 13877634
thanks very much i knew it was going to be somthing like that ur a star :)
LVL 10

Expert Comment

ID: 13877681

no problem glad to help



Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question