In order to learn about dnn, I have been reading related blogs and personal websites of the dnn team recently. I have a lot of questions. I also got answers through the dnn official site Forum. Of course, there are a lot of questions that make Asp.net and dnn veterans disdain for their basic level. However, I would like to thank them for answering the question, at least for the prompt, and also for sharing their knowledge with new people. Here, I will also write some of my learning processes, hoping to be helpful to new users. I always believe that it, especially programming, requires everyone (both foreign and domestic) to share their knowledge and make progress fast enough.
Okay. You don't need to talk about it anymore.
This is Michael's tutorial, which can be called step by step. If you do not develop dnn modules, read this article first.ArticleIt is also very elementary. Similarly, step by step, I believe that I am the best.
Http://www.codeproject.com/KB/applications/LCTDNNModDev.aspx
Http://www.adefwebserver.com/DotNetNukeHELP/DNNTree/
As shown in the following figure, note that I use C #.
The problem is : Objnode. imageindex = Eimagetype. Folder
Vs2005 does not prompt about this, indicating that it is not defined in the context, or reference the relevant class or namespace. First, I used calss view and object view in vs2005 to search for it. No! Then I asked the experts in the dnn Q group and got a prompt. The Enum definition was found in filemanager. ascx. VB. However, it still cannot be referenced. Later, Google made a call, but still failed. So I also sent a mail to Michael and posted a post on the forum. As a result, they all gave me a serious reply. After I completed this exercise, I found thatCode Finally, there are Eimagetype. Folder
. Public Enum eimagetype EnumEimagetype
Folder
Page
End Enum
Very embarrassing!
If the problem persists, post it in the relevant professional forum. If not, mail it to the author. This is because when I saw other Michael tutorials last night, I saw an eye-catching prompt. Please do not mail me. If you have any questions, please go to the Forum. Indeed, he has more readers than Niu Mao in his tutorial, but he is not exhausted yet. Where can I write more tutorials. If you encounter such a problem, you will not be depressed.
2nd questionsThat is, when compiling, an error is prompted. As expected, this problem occurs from VB to C.
Here we recommend a good site, http://labs.developerfusion.co.uk/convert/vb-to-csharp.aspx
It can convert vb c # code.
Of course, I turned it manually. Because there is a small amount of code and there is no need to use tools, I should improve myself.
Objtreenode =Objparent. treenodes (INDEX)
The parentheses outside the index should be replaced with [], you know. If you do not know the reason, please reply in the comments.
In addition,
Dim objtreenode as treenode
Convert to C #
Treenode objtreenode;
If you reference using system. Web. UI. webcontrols in the using namespace;
And using dotnetnuke. UI. webcontrols.
Here, the treenode we use is dotnetnuke. UI. webcontrols;, not system.
Therefore, either explicitly state, write it completely, or change the using system. web. UI. remove webcontrols of webcontrols, because this project does not need webcontrols of system. if you need to use these two webcontrols in the same project in the future, use the former, write it completely, and state it.
3rd questions:
The compilation is successful. In IE, all the icons except the Red Cross are displayed and can be used normally to achieve the expected results.
After reading the property of the icon, http: // localhost/images/folder.gif is displayed. In my system, correct dnn/should be added before images/
In vs2005, check the attributes of the dnntree control and see that systemimagespath has intelligently added images to me. Change it to dnn (if you also use dnn as the virtual directory name ).
Corresponding
There is no need to add "http://www.cnblogs.com/../" like Michael in the code file"
Instead
Dnntree1.imagelist. Add ("images/folder.gif ");
Dnntree1.imagelist. Add ("images/file.gif ");
All OK, if you still encounter any new problems, welcome you in the comments (http://blog.csdn.net/metababy), proposed, so that in the future, other people found this Article, will not have the same doubts.