Welcome Guest Search | Active Topics | Sign In | Register

Server Side Event Handle Options
h0lly
Posted: Friday, August 17, 2007 2:01:32 PM
Rank: Member
Groups: Member

Joined: 8/17/2007
Posts: 11
I am trying out this product in conjunction with learning .net so I'm not sure if I am limited in what I can do until I get a license or there is something wrong with my code.

In my .aspx file
I am using the slide menu.
I have set up the top level of the menu to have the RaisesEvent = True and one of the Items has been set to true (so I expect this will enable the event to be captured).

In my menu I have:
<Items>
<eo:MenuItem ExpandedStyle-CssText="" RaisesServerEvent="True" NormalStyle-CssText="background-color:#000066;color:white;" Text-Html="Junior School" CustomItemID="1">
<SubMenu Style-CssText="">
</SubMenu>
</eo:MenuItem>

In my .vb file
I have Imports EO.Wed and Imports EO.Web.Demo (amongst other Imports)
I have declarations for:
Protected lblMsg As Label (which will display info based on item clicked)
Protected WithEvents Menu1 As EO.Web.Menu

The Event Handler is:
Private Sub Menu1_ItemClick(sender As Object, e As EO.Web.NavigationItemEventArgs) Handles Menu1.ItemClick

lblMsg.Text = String.Format("Menu item '{0}' was clicked.", CType(e.NavigationItem, EO.Web.MenuItem).Text)
End Sub

Is there something that I am missing within the .vb file or is it just that the unlicensed version doesn't allow for event handling?
eo_support
Posted: Friday, August 17, 2007 3:01:40 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Hi,

I do not see anything wrong with your code. You only need to set the item's RaisesServerEvent to true (as you already did in your .aspx file) and it should work. License is not an issue as there is no feature restriction on unlicensed version. The only difference between licensed an unlicensed version is the license warning message.

If you set a break point in Page_Load or ItemClick, do you see the break point hit? Also make sure that you do not have NavigateUrl set. When you have NavigateUrl set, it takes you to another page instead of raising a server event. Another thing you want to check is whether there are other controls in your page that's canceling the post back (such as an validator control), a good way to verify this is try everything out on a blank page.

Please let us know if that still does not solve the problem.

Thanks
h0lly
Posted: Saturday, August 18, 2007 12:31:59 AM
Rank: Member
Groups: Member

Joined: 8/17/2007
Posts: 11
Got it sorted. I forgot to add an id for the menu!!
eo_support
Posted: Saturday, August 18, 2007 7:01:20 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,088
Ah! Thanks for letting us know!


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.