Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Adding my own classes
Hrvoje_86
#1 Posted : Tuesday, February 08, 2011 5:06:33 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/28/2011(UTC)
Posts: 157
Location: Croatia
Is there some way i can add my own classes and functions for use in content templates?
Hrvoje_86
#2 Posted : Friday, February 11, 2011 6:04:41 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/28/2011(UTC)
Posts: 157
Location: Croatia
I found that if i add my clasess in the app_code folder they are availible even in the content teplates.
The only draw back is they don't show up in kooboo intellisense.

The good thing about adding this way is that there is no need to alter source code.

More questions:

1. Is there any way to make my classes also show in intellisense?

2. Is it possible to add functions to existing clasess like HTML.myFunc for example ?
jifeng
#4 Posted : Friday, February 11, 2011 6:06:30 PM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
Hi

Do you still use earlier version? The content templates renamed to "view" in new version.

Sorry, the content template is a general user control. It is unable to add classes, but it is possible to add some functions.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Hrvoje_86
#6 Posted : Friday, February 11, 2011 6:08:01 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/28/2011(UTC)
Posts: 157
Location: Croatia
Hi

Yes i use 2.1 version stable.
version 3 is in alpha version still.
Hrvoje_86
#5 Posted : Friday, February 11, 2011 6:17:09 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/28/2011(UTC)
Posts: 157
Location: Croatia
jifeng wrote:
Hi

Do you still use earlier version? The content templates renamed to "view" in new version.

Sorry, the content template is a general user control. It is unable to add classes, but it is possible to add some functions.


Yes but i created app_code folder in kooboo root and added my Test class and it works!
I was able to write
Code:

<%
Test tst = new Test()
<%
<%=test.msg()%>

It works like that.

Can you tell more how intellisense works in kooboo how does it know which code to show?
Can it be extended?

Could you give me an example how to add (overide?) a new function in an existing class?
jifeng
#3 Posted : Friday, February 11, 2011 6:46:53 PM(UTC)
Rank: Administration
Groups: Administrators, Registered

Joined: 9/3/2009(UTC)
Posts: 1,555
Location: Xiamen China
Hrvoje_86 wrote:
I found that if i add my clasess in the app_code folder they are availible even in the content teplates.
The only draw back is they don't show up in kooboo intellisense.

The good thing about adding this way is that there is no need to alter source code.

More questions:

1. Is there any way to make my classes also show in intellisense?

2. Is it possible to add functions to existing clasess like HTML.myFunc for example ?


1. The code under app_code folder is compiled dynamic, I think it is impossible to show intellisense.

2. Create a extension class in third assembly.
Regards,

Jifeng Huang

Kooboo Team

Microsoft ASP.NET MVP
Hrvoje_86
#7 Posted : Friday, February 11, 2011 6:52:26 PM(UTC)
Rank: Advanced Member
Groups: Registered

Joined: 1/28/2011(UTC)
Posts: 157
Location: Croatia
Ok thank you for the fast reply.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.560 seconds.