SourceTec Software

It is currently Thu Apr 24, 2014 7:28 pm

All times are UTC + 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Jun 26, 2009 8:06 am 
Offline
Member

Joined: Fri Jun 26, 2009 5:43 am
Posts: 6
I can create a page with the databased menu in .aspx and SQL where I copy the javascript and paste it into the BODY. Works fine.

For cleaner pages, we want to create a separate .js and put that in the BODY. I've done this many times and can not get it to work. Any hardcoded menu items work fine; databased menu parts don't show up.

Any ideas on how to fix this or a sample from someone on how to do this in .aspx with SQL?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 27, 2009 4:16 pm 
Offline
Guru

Joined: Wed Jan 31, 2007 4:21 am
Posts: 1116
well if you have asp code in the .js file you need to rename it to an asp extension and include that file in an asp way.


Top
 Profile  
 
 Post subject: ASPX and SQL
PostPosted: Tue Jun 30, 2009 3:13 am 
Offline
Member

Joined: Fri Jun 26, 2009 5:43 am
Posts: 6
After a lot of trial and error, the way to get the coding to work with ASP.NET (VB) is to create a WebUserControl. Basically you can have SoThink create a .js file and then copy and paste that into the WebUserControl. Drag the control onto the Design view of the page.

My WebUserControl page looks something like this:

<%@ Control Language="VB" AutoEventWireup="false" CodeFile="NetMenu_WebUserControl.ascx.vb" Inherits="NetMenu_WebUserControl" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQLClient" %>

<script type="text/javascript">
<!--
******** paste the content from the .js file here ********
//-->
</script>

I will note that I am using a couple of looped datasets and in one place the file requires /* and */, while inother places it doesn't.

Hope this helps anyone else using .NET.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group