We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now


website conversion to asp.net

Fraser_Admin asked
Medium Priority
Last Modified: 2008-01-16
I have a website, that I would like to convert to data driven, asp.net
existing website pages use a bit of javaScript(menu,header, footer display)and some html tables and graphics. Can I reuse this code and design in my asp.net 2.0 pages(website)?or do I need to recreate it in asp pages?
Can I use asp.net for content display, and keep the pages display clientside?

would anyone know of a link, or tutorial on how to do this, if it can be done

information would be appreciated

Watch Question

I found the easiest way to convert html pages to ASP was by using Web Matrix.  You open the HTML source using this program, and then do a "Save As" to convert it asp files.  Then, you can go in and start adding the dynamic things that you want.  

There are books available on Web Matrix.  I chose "Microsoft ASP.NET Web Matrix Starter Kit", a decent book.  Used on Amazon for under $10.

Here is the official ASP.Net 2.0 website that has Web Matrix and the newer Visual Web Developer Express.




I tried "save as"  but it only put an .aspx extension on the file name, instead of .html, the code did not change in the file?

Realize that ASP.NET is an embedded language.

For example, where you have a hard-coded drop-down box for selecting a state,
you will replace this with ASP: code that will get the info from your database.

Only minor changes should have been made to the source.  Anything that does
not have an end tag, (<br> is the most obvious), will have that added to the
source.  You may also get it for <li> tags that were not ended with </li>.

You now have to start making your changes in the correct locations within the HTML

Not meaning to sound harsh, but is this your 1st run at ASP?  I can post a small sample
or send you some examples of stuff I have done.  Or, there is stuff to be found on the web, if you look hard enough.




all I want to do is reuse a clientside built website pages and design,

the hardest is the javascript, the html is fine, but I want to run the menu.js,header.js, footer.js on the client.

 i'm using VS 2005, I think I'll have to redesing the pages in asp.net

it's not the stuff from the database that I have troublee with, it's displaying the javascript on the clientside


Now I am getting a bit lost....

Are you asking if you can intermingle ASP and Javascript in the same page?  Yes

Are you asking if you can intermingle ASP.NET and Javascript in the same page?  Yes

Are you wanting to convert Javascript to ASP/ASP.NET?  Not sure, but no need to..

Your comment about running the menu.js, header.js, footer.js on the client is
puzzling, as all javascript is run on the browser.

Where am I puzled?



yes all javascript runs in the browser, and all asp.net runs on the server, at least goes to the server and back or am I not understanding correctly. please enlighten me if I am wrong

how do we fit clientside code like this in a aspx page?and where would the .js files be in the solution, would they get compiled with the solution?

<script language="JavaScript" src="pop-closeup.js"></script>
<script language="JavaScript" src="javascripts.js"></script>

<div id="scroller1" class="menu-location">
<script language="JavaScript" src="menu.js"></script>
<script language="JavaScript" src="menu_floating.js"></script>

where is there an example of running javascript code,  like a javascript menu in asp.net 2.0 I cannot find anything on the subject

and how do you code javascript in asp.net pages? I was thinking of putting the javascript menu into master pages but do not know how to modify the pages for this


When you write ASP code, it basically generates html code on the server with the database stuff you want and merges it in the code where you wanted and sends it back to the browser.  

You asked where the <script ...> line exist in a source.  Answer:  Wherever you want them to be rendered on the page.

As for the location of the *.js files, they stay with your web pages .aspx files on the web server.

Here is a block of code from one of my projects.  Shows how to embed the asp code and javascript references in your HTML tags

<table cellspacing="0" cellpadding="0" width="750" border="0">
  <script language="JavaScript" src="header.js" type="text/javascript"></script>
  <!-- PAGE BANNER -->
  <a href="index.html"><img class="borders" height="100" alt="image"
           src="home.jpg" width="750" border="0" /></a>
  <!-- MENU CALL -->
  <script language="JavaScript" src="menu.js"></script>
  <!-- SPLIT TABLE-->
  <table cellspacing="0" cellpadding="0" width="650" border="0">
    <tr align="right">
      <td colspan="2">
         <form id="Form1" runat="server">
          <asp:Label id="loginFailed" runat="server" forecolor="red" visible="false">Login failed</asp:Label>UserID:<input id="userID" type="text" runat="server" />&nbsp;Password:<input id="passWord" type="password" runat="server" />
          <asp:Button id="submit" runat="server" onCommand="Login" text="Submit"></asp:Button>
    <td valign="top" align="left" width="160">
      <script language="JavaScript" src="sidebar.js" type="text/javascript"></script>
    <td valign="top" align="middle">
    <!-- CONTENT TABLE -->
    etc etc

Did that make it clearer than mud?


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts


it does make it clearer, could you send me this sample solution? I would like to study it if possible.

thanks again for your help


Where to send?



appreciate it,

No go, the system shoots me the following msg...

pr.fraserpapers.com.inbound10.mxlogic.net[] said: 554 Message   Denied: Restricted attachment (Mode: normal) (in reply to end of DATA   command)

Maybe because I have an embedded mdb file in there?



send me a email, with no attachment and I will contact the sysadmin for the firewall?



a zip usually goes
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.