Thursday, March 22, 2012

Simple Dropdown Box Issue

Hi All,

Can anyone throw me a bone here! Any help much appreciated

Compiler Error Message: BC30456: 'text' is not a member of 'System.Web.UI.WebControls.DropDownList'.

Source Error:

Line 21: Sub DropDownList3_SelectedIndexChanged(sender As Object, e As EventArgs)
Line 22:
Line 23: if DropDownList3.text = "My Text" then
Line 24:
Line 25: label10.text="Expiry"
end if
end subif DropDownList3.SelectedItem.text = "My Text" then
cheers windy!
Sorry have one more issue.

Any help here would be most apreciated...

Compiler Error Message: BC30451: Name 'DropDownList3' is not declared.

Source Error:

Line 48:
Line 49:
Line 50: if DropDownList3.SelectedItem.text = "Maestro (formerly Switch)" then
Line 51: label21.text = "Issue Number"
Line 52: end if
Is it in C# ASP.NET? have you debugged line by line? what is it in your obejct value?
It means that DropDownList3 is not accessible from line 50. Did you declare it as a public or protected member of your page class?
Hi

Thanks for the post..(sorry Im pretty new to this)

Do I have to declare every list box and text field.....Im sure I havent in the past

pLease can u give me an example of what I would do to declare

thanks
Tony
If the control is in the ASPX page, and you refer to it directly in Code-Behind, it must be declared in the Code-Behind file, first, so that it can be recognized in the events.

(assuming you're using Code-Behind?)

if not - check the spelling of the control in both places
Hi AW,

Thanks again for your help here

I am clicking on the 'Code Tab' at the bottom of the screen (code behind?)

Please can you have a look at what I have tried so far....

I am trying to populate a Label control depending what is selected from a dropdownlist.

At the moment I get no errors......it just does not work.....

again...any help will help me learn...

many thanks

Tony

Public Cardt as string
Public lab as string

Sub DropDownList3_SelectedIndexChanged(sender As Object, e As EventArgs)

cardt= DropDownList5.SelectedItem.text
lab = Label21.text

If cardt= "My Selection" then
lab = "Hello"
end if

End Sub
its ok i have sorted it now.....thanks anyway

0 comments:

Post a Comment