The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Navigation bar ASP.net
Louffeman
post Dec 3 2016, 11:51 AM
Post #1


Member
***

Group: Members
Posts: 69
Joined: 21-June 14
Member No.: 21,123



Hi,
my webmaster has created a site for me in using ASP.net
I find the code source of navigation bar in Dreamweaver and browser are different,
could someone explain for me ?

Dreamwver code source:

<div class="nav">
<ul class="middle">
<li class="li1"><a href="./">Home</a></li>
<li class="li1"><a href="about.asp">About Us</a>
<div class="ul2">
<ul class="middle">
<%
sql="select * from query_info where QType='about' order by order_info desc,id asc"
Rs.open sql,conn,1,1
do while not rs.eof
%>
<li class="li2"><a href="about.asp?id=<%=Rs("id")%>"><%=Rs("Subject")%></a></li>
<%
Rs.movenext
loop
Rs.close
%>
</ul>
</div>
</li>
<li class="li1"><a href="product_show.asp">Product</a>
<div class="ul2">
<ul class="middle">
<%
sql="select top 8 * from product_sort where QType='products' order by orderno desc,id asc"
'response.write sql
Rs.open sql,conn,1,1
do while not rs.eof
%>
<li class="li2"><a><%=Rs("SortName")%></a>
<ul class="ul3">
<%
set Rs1=server.CreateObject("adodb.recordset")
sql="select * from query_products where QType='products' and SortID="&Rs("id")&" order by order_info desc,id asc"
Rs1.open sql,conn,1,1
do while not rs1.eof
%>
<li><a href="product_show.asp?id=<%=Rs1("id")%>"><%=Rs1("ProductName")%></a></li>
<%
Rs1.movenext
loop
Rs1.close%>
</ul>
</li>
<%
Rs.movenext
loop
Rs.close%>
</ul>
</div>
</li>
<li class="li1"><a href="service.asp">Press</a></li>
<li class="li1"><a href="contact.asp">Contact Us</a></li>
</ul>
</div>
</div>

Browser code source:
<div class="nav">
<ul class="middle">
<li class="li1"><a href="./">Home</a></li>
<li class="li1"><a href="about.asp">About Us</a>
<div class="ul2">
<ul class="middle">

<li class="li2"><a href="about.asp?id=345">About1</a></li>

<li class="li2"><a href="about.asp?id=346">About2</a></li>

<li class="li2"><a href="about.asp?id=347">About3</a></li>

<li class="li2"><a href="about.asp?id=349">About4</a></li>

</ul>
</div>
</li>
<li class="li1"><a href="product_show.asp">Products</a>
<div class="ul2">
<ul class="middle">

<li class="li2"><a>Title1</a>
<ul class="ul3">

<li><a href="product_show.asp?id=559">Pro1</a></li>

<li><a href="product_show.asp?id=561">Pro2</a></li>

<li><a href="product_show.asp?id=560">Pro3</a></li>

</ul>
</li>

<li class="li2"><a>item2</a>
<ul class="ul3">

</ul>
</li>

<li class="li2"><a>item3</a>
<ul class="ul3">

</ul>
</li>

<li class="li2"><a>item4</a>
<ul class="ul3">

</ul>
</li>

</ul>
</div>
</li>
<li class="li1"><a href="service.asp">Press</a></li>
<li class="li1"><a href="contact.asp">Contact Us</a></li>
</ul>
</div>
</div>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
Christian J
post Dec 3 2016, 02:56 PM
Post #2


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



ASP.net uses a server-side script, which is interpreted and turned into HTML on the server. After this the finished HTML is sent to the browser.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 3 2016, 05:10 PM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



The bits that look like this to be specific.
CODE
<%
...
%>

You will never see those when you view source over a server. Unless something is wrong.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Louffeman
post Dec 4 2016, 02:45 PM
Post #4


Member
***

Group: Members
Posts: 69
Joined: 21-June 14
Member No.: 21,123



QUOTE(pandy @ Dec 3 2016, 05:10 PM) *

The bits that look like this to be specific.
CODE
<%
...
%>

You will never see those when you view source over a server. Unless something is wrong.


CODE
<%
...
%>

it's not the ASP.Net code ?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 4 2016, 02:59 PM
Post #5


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



QUOTE(Louffeman @ Dec 4 2016, 08:45 PM) *


CODE
<%
...
%>

it's not the ASP.Net code ?


Yes, the ASP code is within those signs. And that's why you don't see it over the server. The server interprets the ASP and replaces it with what the code instructs it do do. What's sent to the browser is always plain HTML (and CSS and JavaScript). The ASP is all gone. Another programming language that can be embedded in HTML like this is PHP. It's called pre processing. Languages like for example Perl work differently. A Perl script can be called from a HTML page but you can't embed snips of programming like this.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 4 2016, 04:12 PM
Post #6


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ Dec 4 2016, 08:59 PM) *

Languages like for example Perl work differently. A Perl script can be called from a HTML page

How is Perl different, and how is that done? unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Dec 4 2016, 04:24 PM
Post #7


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,730
Joined: 9-August 06
Member No.: 6



I meant in the sense that you can't embed actual programs/scipts in a HTML page and have the server parse the page for that as with PHP and ASP. It isn't a preprocessor (if that's even a term). Instead the script must be called, like when submitting a form. The result can be that the script generates a whole now page with the desired result.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th April 2024 - 10:35 AM