• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 728
  • Last Modified:

website conversion to asp.net

Hi,
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

Daniel
0
Fraser_Admin
Asked:
Fraser_Admin
  • 7
  • 7
1 Solution
 
Bob BenderCommented:

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.

http://www.asp.net/webmatrix/
0
 
Fraser_AdminAuthor Commented:
thanks

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?

0
 
Bob BenderCommented:

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
code.  

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.

Bob









0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
Fraser_AdminAuthor Commented:

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

Daniel
0
 
Bob BenderCommented:

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?

Bob
0
 
Fraser_AdminAuthor Commented:
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>
</div>
<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



 
0
 
Bob BenderCommented:

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">
<tbody>
  <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">
  <tbody>
    <tr align="right">
      <td colspan="2">
         <table>
         <form id="Form1" runat="server">
        <tbody>
          <tr>
             <td>
          <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>
        </tr>
      </tbody>
      </table>
    </td>
  </tr>
  <tr>
    <td valign="top" align="left" width="160">
      <script language="JavaScript" src="sidebar.js" type="text/javascript"></script>
    </td>
    <td valign="top" align="middle">
    <!-- CONTENT TABLE -->
    etc etc


Did that make it clearer than mud?

Bob
0
 
Fraser_AdminAuthor Commented:
thanks,
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

Daniel
0
 
Bob BenderCommented:

Where to send?

Bob
0
 
Fraser_AdminAuthor Commented:
appreciate it,
bertind@pr.fraserpapers.com
0
 
Bob BenderCommented:

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

pr.fraserpapers.com.inbound10.mxlogic.net[208.65.144.3] 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?

bob
0
 
Fraser_AdminAuthor Commented:
send me a email, with no attachment and I will contact the sysadmin for the firewall?
Daniel
0
 
Bob BenderCommented:

sent
0
 
Fraser_AdminAuthor Commented:
a zip usually goes
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 7
  • 7
Tackle projects and never again get stuck behind a technical roadblock.
Join Now