Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Databases _ Navigation bar ASP.net

Posted by: Louffeman Dec 3 2016, 11:51 AM

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>

Posted by: Christian J Dec 3 2016, 02:56 PM

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.

Posted by: 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.

Posted by: Christian J Dec 3 2016, 05:52 PM

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

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

True. Sometimes things do go wrong though, so don't rely on the server for hiding sensitive data (e.g. passwords) this way. Ideally such data should be included by the script from files above the web root.

Posted by: Louffeman Dec 4 2016, 02:45 PM

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 ?

Posted by: Louffeman Dec 4 2016, 02:48 PM

QUOTE(Christian J @ Dec 3 2016, 05:52 PM) *

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

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

True. Sometimes things do go wrong though, so don't rely on the server for hiding sensitive data (e.g. passwords) this way. Ideally such data should be included by the script from files above the web root.

the Dreamweaver code is impossible to understand, I cannot modify to increase or cancel a item

Posted by: pandy Dec 4 2016, 02:59 PM

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.

Posted by: pandy Dec 4 2016, 03:00 PM

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

the Dreamweaver code is impossible to understand, I cannot modify to increase or cancel a item


Afraid I don't know anything about Dreamweaver. Neither does Christian AFAIK. So you're on your own there.

Posted by: Christian J Dec 4 2016, 04:12 PM

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

Posted by: Christian J Dec 4 2016, 04:24 PM

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

the Dreamweaver code is impossible to understand, I cannot modify to increase or cancel a item

Do you mean the ASP script code you can see in DreamWeaver? I don't think Dreamweaver is the problem, but ASP uses different scripting languages (like JScript or VBScript) that you need to understand.

I also see database queries in your ASP code example, perhaps it's those database entries that need to be edited? Alas I don't know how that works with ASP.NET.




Posted by: pandy Dec 4 2016, 04:24 PM

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.

Posted by: pandy Dec 4 2016, 04:29 PM

QUOTE(Christian J @ Dec 4 2016, 10:24 PM) *

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

the Dreamweaver code is impossible to understand, I cannot modify to increase or cancel a item

Do you mean the ASP script code you can see in DreamWeaver? I don't think Dreamweaver is the problem, but ASP uses different scripting languages (like JScript or VBScript) that you need to understand.

I also see database queries in your ASP code example, perhaps it's those database entries that need to be edited? Alas I don't know how that works with ASP.NET.


Or if the document can't be edited at all, maybe it's that DW feature, forgot what it's called, that prevents everything but specially denoted sections to be edited? Some collaboration thing, so people with less skills can't *beep* up the whole document.

Posted by: Louffeman Dec 5 2016, 10:48 AM

QUOTE(pandy @ Dec 4 2016, 04:29 PM) *

QUOTE(Christian J @ Dec 4 2016, 10:24 PM) *

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

the Dreamweaver code is impossible to understand, I cannot modify to increase or cancel a item

Do you mean the ASP script code you can see in DreamWeaver? I don't think Dreamweaver is the problem, but ASP uses different scripting languages (like JScript or VBScript) that you need to understand.

I also see database queries in your ASP code example, perhaps it's those database entries that need to be edited? Alas I don't know how that works with ASP.NET.


Or if the document can't be edited at all, maybe it's that DW feature, forgot what it's called, that prevents everything but specially denoted sections to be edited? Some collaboration thing, so people with less skills can't *beep* up the whole document.

My aim is to modify the navigation bar by myself, now it seems not possible

Posted by: Louffeman Dec 5 2016, 10:49 AM

QUOTE(Christian J @ Dec 4 2016, 04:24 PM) *

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

the Dreamweaver code is impossible to understand, I cannot modify to increase or cancel a item

Do you mean the ASP script code you can see in DreamWeaver? I don't think Dreamweaver is the problem, but ASP uses different scripting languages (like JScript or VBScript) that you need to understand.

I also see database queries in your ASP code example, perhaps it's those database entries that need to be edited? Alas I don't know how that works with ASP.NET.

the Microsofe Access is the database for ASP.Net,
do you know the PHP, has it database software ? which is his name ?

Posted by: Christian J Dec 5 2016, 01:58 PM

QUOTE(Louffeman @ Dec 5 2016, 04:48 PM) *

My aim is to modify the navigation bar by myself, now it seems not possible

What do you want to change in it? The link URLs and link texts can be modified in the database.

Posted by: Christian J Dec 5 2016, 01:58 PM

PHP can be used with many different databases, maybe MS Access too, but I don't know any details.

Posted by: Louffeman Dec 6 2016, 04:18 AM

QUOTE(Christian J @ Dec 5 2016, 01:58 PM) *

PHP can be used with many different databases, maybe MS Access too, but I don't know any details.

thank for your kindly replys

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)