Solved

website conversion to asp.net

Posted on 2006-11-01
14
695 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
  • 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
 

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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Uploading files to the web server has become common part of almost any kind of web application. People use different technologies to solve this, but regardless of the technology used, it is always useful to have some kind of progress indicator shown…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

707 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now