Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All

after i removed the namespace from the code behind the page

the name space which i have removed is shown in this screenshoot

then the code behind the page became like this : screenshoot


, i got issue with used controls inside my page and showing the error : the control is not exist in the current context.

the code source of the page is like in this link : screen shoot

how to solve this as i dont want to use the namespace because im following a video tutorial and they are not using it.

What I have tried:

im beginner and didnt know what to do
Posted
Updated 27-Nov-16 6:09am
v3
Comments
Kornfeld Eliyahu Peter 27-Nov-16 9:59am    
What namespace have your removed?
Syamandm 27-Nov-16 10:05am    
i upload the screenshoot.. http://pictub.club/image/xS1nn

and i changed to this inside this screen shoot : http://pictub.club/image/xSsh8

1 solution

The best thing to do is throw this project away and start again. The code that is auto-generated by Visual Studio is there for a reason. You can still follow the video, just leave the namespace as it is. If you notice the definition of your webform2 is declared as
C#
public partial class webform2 : System.Web.UI.Page

The key point being the word partial which indicates that some part of the class definition exists in another file, which will still have the namespace declaration. Unless you really understand how all the pieces fit together it is best not to try changing it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900