Knowledge Base support case for AllWebMenus,  abstracted and stripped of all userโ€™s private info.


Initial Email From:
John
Email Subject: Using an asp.net form in a megamenu
Support Case Month: May 2013

Is there a way to include an asp.net form within a menu subgroup? We have a conventional html-based megamenu design, to which I would like to add asp.net controls to display item prices and urls loaded from a datasource.
John

Reply From: Likno Customer Support

Dear John,

This is not impossible, but it may be tricky and in any case it requires custom code.

It is not possible to include server-side code (ASP) into client-side code (JS), but it is possible to include it in the HTML of your page.

Hence I believe the best approach is to use an in-page UL/LI structure for populating your menu and include the ASP there.

Note that AllWebMenus can give you a sample code of the UL/LI you need to have in your page, based on your existing menu:

clip_image001

clip_image002

clip_image003

Best Regards,
Kostas
Likno Customer Support
www.likno.com
Create any type of javascript menu (CSS menu, drop-down menu, sliding menu), button, html tree, modal window, tooltip, accordion, tab, scroller, jQuery slider or design for your websites!
Like us on Facebook โ€“ Follow us on Twitter

Reply From: John

That was fast, Kostas! 

I appreciate your answer, but I don't believe it answers my question. ๐Ÿ™‚

We already have a megamenu with subgroup items that are in HTML.  My question is whether we can use asp.net controls within the subgroup's HTML. I tried it, but it didn't seem to want to work.

Does that explain my problem more clearly?

I hope all's well with you.

Regards

John

Reply From: Likno Customer Support

Dear John,

Sorry for the misunderstanding, I will try to explain this further.

I understand that you typed your HTML code within AllWebMenus, right? This means that the HTML code is included in the compile JavaScript file which you then upload online.

The problem is that any code you add in a JavaScript file, will not be processed by the server, hence any server-side code you add (such as the ASP include code) will appear as plain HTML or text inside your menu and will not be processed by the server.

If on the other hand you put your population code in your HTML page, then (if you also have this configured on your server, which is very likely) this page will be first processed by the server for server-side code and it will then be served to the client. This way the server-side code will work.

The downside of using UL/LI code to populate your menus is that you need to have this code in each of your pages, however this is not much of a problem as you can add this code in yet another ASP include file, or (if you have one) in your template file.

I hope this was more clear than my previous answer. Let me know if you need more help.

Best Regards,
Kostas
Likno Customer Support
www.likno.com
Create any type of javascript menu (CSS menu, drop-down menu, sliding menu), button, html tree, modal window, tooltip, accordion, tab, scroller, jQuery slider or design for your websites!
Like us on Facebook โ€“ Follow us on Twitter

Reply From: John

Dear Kostas

That's very clear. Thanks!  Looks like I'm heading for a world of pain again!!

Bests,
John