Click to See Complete Forum and Search --> : HTML to ASPX Problem
darkgatepaul
09-05-2007, 12:27 PM
so what im doing is taking a website that was built in html and throwing it into aspx so i can have the vb code behind to do database work with the site. For some of the pages there are some Javascript files that are included. The javascript files are being used to communicate with a flash "slider" that is on the page. The object is that when the slider moves it sets a cookie that increases a number from 0 to 100. The problem Im having is that the pages work perfectly when they are in their .htm format. But even if i throw the html directly into the .aspx page the Flash slider no longer works.
Any idea on what im doing wrong would be greatly appreciated. If you would like some of the code just let me know.
lmf232s
09-06-2007, 11:49 AM
Would need to see some code.
ARe you including the javascript files?
thechasboi
09-07-2007, 11:56 AM
darkgatepaul
You need to include the javascript file exactly the same way you would if the page was pure html code. The same goes with css files. Hope this helps.
lotuzwine
09-24-2007, 10:59 AM
Asp.Net renders controls to HTML quite diferent from the original. For example, if you are using an asp.net panel:
<asp:Panel id="pnl1" runat="server" >
<!-- some html -->
</asp:Panel>
when it renders to HTML, it will be something sligthy diferent like this:
<div id="ctl01_ctl03_pnl1" >
<!-- some html -->
</div>
Analyse the HTML source code when the page is renderized (loaded in browser) and check out if your javascript is referencing any of these Id's that are being rendered by the Asp.Net controls.
Example:
if your javascript referenced the id "pnl1" from the Asp:Panel, it will not work when the HTML is rendered, since now the id is "ctl01_ctl03_pnl1". Any tag referenced by your javascript should be non Asp.Net tags, so they will remain their original Id.
Hope that helps
thechasboi
09-24-2007, 11:12 AM
lotuzwine has some good points. The auto generated ID's and names are annoying but you can control the id's by specifying of your self. I ran into this when I tried to get a for to submit through the opener and being a .net form. I had to add a name and a different id manually to get the script from the opener to work.