I am facing a small big problem. I have taken a dropdownList control and ID is
"drpDownCountries
" in ASP.Net project. The problem is that "The dropdownlist control
is placed on page, in the code behind file of c#, while typing the control name "drpDownCountries"
, this control ID is listed in object member list.
But, in compiling the project I am getting following error.
Error : - The name 'drpDownCountries' does not exist in the current context.
I have checked this thing on different machines too. But same error is occurring. I do not understand what is the reason behind that.
Many a times while writing a code we get this error which says, “The name does not exists in the current context”. This is because the code behind file is not able to find the control being added to your aspx file.
The aspx file contains your page markup. It's automatically converted into code by ASP.NET. The cs file contains the code behind your page (initialization, event handlers, etc.). You have to write that code yourself.
Right-click on the ASPX (or ascx) file, and select Convert to web application (or something like that). That will force a refresh on the designer file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With