Solved

website conversion to asp.net

Posted on 2006-11-01
14
709 Views
Last Modified: 2008-01-16
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
Comment
Question by:Fraser_Admin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
14 Comments
 
LVL 5

Expert Comment

by:Bob Bender
ID: 17849942

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
 

Author Comment

by:Fraser_Admin
ID: 17851622
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
 
LVL 5

Expert Comment

by:Bob Bender
ID: 17851770

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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:Fraser_Admin
ID: 17851948

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
 
LVL 5

Expert Comment

by:Bob Bender
ID: 17853047

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
 

Author Comment

by:Fraser_Admin
ID: 17854276
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
 
LVL 5

Accepted Solution

by:
Bob Bender earned 500 total points
ID: 17854435

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
 

Author Comment

by:Fraser_Admin
ID: 17857237
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
 
LVL 5

Expert Comment

by:Bob Bender
ID: 17857270

Where to send?

Bob
0
 

Author Comment

by:Fraser_Admin
ID: 17857419
appreciate it,
bertind@pr.fraserpapers.com
0
 
LVL 5

Expert Comment

by:Bob Bender
ID: 17858325

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
 

Author Comment

by:Fraser_Admin
ID: 17862621
send me a email, with no attachment and I will contact the sysadmin for the firewall?
Daniel
0
 
LVL 5

Expert Comment

by:Bob Bender
ID: 17862666

sent
0
 

Author Comment

by:Fraser_Admin
ID: 17862675
a zip usually goes
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
This video teaches users how to migrate an existing Wordpress website to a new domain.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question