ASP.NET 2.0 C# DropDownList

B

Bradd Schick

Why Does this cause an erorr in compliation....
Heres the error " CS0103: The name 'DDRoleList' does not exist in the
current context "

Heres a piece of the code, I am using C#.
"void DataBind()
{
DDRoleList.DataSource = Roles.GetAllRoles();
DDRoleList.DataBind();
}"

DDRoleList is the "ID" of my DropDownList.

So why does this not work? Thanks for the help!
 
A

Alvin Bruney [MVP]

check your case sensitivity, c# is case sensitive.
also check the declaration at the top of the file to see if something funky
is going on.
 
B

Bradd Schick

Thanks Alvin,

But the problem was due to the DropDownList and other controls that were
placed within the CreateUserWizardTemplate had to be refered to as
@_controlx were x is the number of the control.

My problem now is how will this affect the rest of the application? This
page works, but do you see any problems with this approach?

Thanks for the reply

Bradd

Alvin Bruney said:
check your case sensitivity, c# is case sensitive.
also check the declaration at the top of the file to see if something funky
is going on.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Bradd Schick said:
Why Does this cause an erorr in compliation....
Heres the error " CS0103: The name 'DDRoleList' does not exist in the
current context "

Heres a piece of the code, I am using C#.
"void DataBind()
{
DDRoleList.DataSource = Roles.GetAllRoles();
DDRoleList.DataBind();
}"

DDRoleList is the "ID" of my DropDownList.

So why does this not work? Thanks for the help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top