473,788 Members | 2,741 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asp.net 2.0 and Dreamweaver

Can you use Dreamweaver and VS.Net together now?

I have a site that was built with DW code inside (therefore you could not
use VS.Net 2003 with it).

Is this still the case?

Apparently, you can use code inside with the new version version of VS, but
do you have to run the site as a total site or can you use both side by
side.

I would like to convert my site to asp 2.0 and use VS with it, but I don't
want to do that if there is going to be problem using VS with all the pages
I used DW to create.

Thanks,

Tom
Feb 17 '06 #1
7 3990
Are you talking about the code as inline code rather than code in a
code behind? I use VS.Net 2003 with dreamweaver (dreamweaver for
design stuff), but I will always jump back to VS for adding controls to
the page and such (since it creates the stuff i need automatically in
the code behind).

Just go to a aspx file in the solution explorer, right click, open
with, then add the dreamweaver executable to the list (you can make it
default, but messes with code behind or resx, something).

If you could clarify what you mean by "DW code inside" that would help.

Regards,
Darren Kopp
http://blog.secudocs.com/

Feb 17 '06 #2
"Darren Kopp" <da********@gma il.com> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
Are you talking about the code as inline code rather than code in a
code behind? I use VS.Net 2003 with dreamweaver (dreamweaver for
design stuff), but I will always jump back to VS for adding controls to
the page and such (since it creates the stuff i need automatically in
the code behind).

Just go to a aspx file in the solution explorer, right click, open
with, then add the dreamweaver executable to the list (you can make it
default, but messes with code behind or resx, something).

If you could clarify what you mean by "DW code inside" that would help.
When I talk about code-inside, I am talking about one page for both code and
design as opposed to code behind. This is also the direction MS is taking
in VS 2005. You now have 3 models, apparently.

In VS2003, you had to use Code behind, so that if you used a single page, it
wouldn't work in VS 2003.

I have a site with all my pages single .aspx pages. There are no .aspx.vb
(or aspx.cs).

Thanks,

Tom
Regards,
Darren Kopp
http://blog.secudocs.com/

Feb 17 '06 #3
Yep, it does. Check out
http://msdn.microsoft.com/library/en...pnetto2_topic6.
I believe the inline code has intellisense too :D

Happy .NETing,
Darren Kopp
http://blog.secudocs.com

Feb 17 '06 #4
Then click the "The ASP.NET 2.0 Coding Model" link... tried to put the
anchor, but it doesn't jump there automatically.

-Darren

Feb 17 '06 #5
"Darren Kopp" <da********@gma il.com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
Yep, it does. Check out
http://msdn.microsoft.com/library/en...pnetto2_topic6.
This is good news.

But I believe their explanation is totally wrong.

I have had the debate (code-inside or Code-inline vs Code-Behind) with many
people in the past and still prefer the one page approach. Apparently, so
does MS since it is now the default model (according to this article). I
have even been told that PROFESSIONAL programmers use code behind, as if
there were no professional programmers before VS.

The error in the article is comparing asp.net code-inside(inline) with asp.
This is absolutely incorrect.

*************** *************** *************** *************** *************** *************** *******
In ASP.NET 1.x, you could develop an ASP.NET page in one of two ways. First,
you could put your code directly inline with your ASP.NET tags. The code
inline model is very similar to the coding model that was prevalent with
classical ASP and other scripting languages. However, the code inline model
has several problems, such as the intermixing of code and HTML. ASP.NET 1.0
introduced the code-behind model as a replacement. The code-behind model
used an external class to house the code, while the ASPX page contained the
HTML and ASP.NET tags. The code-behind model thus successfully separated
code from content; however, it created some interesting inheritance issues
and forced the developer to keep track of two files for each Web page.

Although ASP.NET 2.0 still supports both of these models, several
significant changes have been made.
*************** *************** *************** *************** *************** *************** **************

You don't mix the html code and scripting code as you do in asp. You have
complete separation as you do in the Code-Behind. The separation happens by
putting the Script at the top of the page and the HTML at the bottom. (or
you could reverse this, I suppose).

Code Inline
*************** *************** *************** *************** *************** *************** *************** **********
The code inline model is now the default model for Visual Studio 2005. Any
code you add to the page will automatically be added to a <script> block
within the ASPX file instead of to a code-behind class. However, Visual
Studio 2005 still displays the code in the code view. In other words, you
can keep using Visual Studio like you always have, except that code will be
placed directly in the ASPX page instead of a separate class.
*************** *************** *************** *************** *************** *************** *************** *********

As they say here (and as I have always said), inline still keeps the
separation. But according to this, VS will create the Script block for
you - which is fine.

This always made more sense than that the 2 file method.

What I am curious about, is whether it will recognise old code not written
in VS and handle it correctly, or is there some hidden code somewhere that
MS uses to navigate the page and site.

I would like to just start using VS2005 on my current site and bring it up
to 2.0, without having to rewrite all my pages to work with the new models
set up by MS. It sounds like this is the case, unless there is some gotcha
that you won't find out about until you try it.

Thanks,

Tom
I believe the inline code has intellisense too :D

Happy .NETing,
Darren Kopp
http://blog.secudocs.com

Feb 17 '06 #6
Well, technically you don't have to re-write the code. There are,
however, changes between 2.0 and 1.1, so you may have to rewrite some
code. I have not used the inline approach, i have used the code behind
model, so I am not sure if what i say next will apply. But I had some
1.1 code that i brought into a 2.0 project and tried to compile but
with errors because some of the coding techniques i used were now
obsolete, and the compiler recommended what to do instead.

So, the 1.1 to 2.0 conversion isn't guaranteed to not have any code
rewriting, but for non-obsolete code it should work fine with VS2005.
I know there is a conversion wizard that will help you convert all of
the existing code, but I believe that is for project based applications
with code-behind, but it may apply to inline files as well, I have not
tried.

Also, I think the part where it talks about the inserting of script
block and that is this: the code automatically goes into the script
block, but i believe there are 2 different views for looking at the
aspx source. One of them is HTML view which shows all of the html and
the script blocks, and then i think there is a code view, which shows
only the <script> blocks, but as i have not tried it i cannot guarantee
that's how it is.

As for the comparison to ASP, I think that is correct, depending on how
you set up your ASP page. Similar to the <script> blocks, a developer
could have just encapsulated all of the code between <% %> blocks at
the beginning of the page, and then called the sub routines and
functions throughout the page. This lead to "spaghetti code", but I
think in some aspects that still exists in .NET, even with a
code-behind model.

All in all i guess it all comes down to preference, and I guess that is
why Microsoft supports both methods, and I personally can see
advantages within each method (I admit, sometimes I get bothered having
to open the code-behind for the page).

Regards,
Darren Kopp

Feb 17 '06 #7
"Darren Kopp" <da********@gma il.com> wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
Well, technically you don't have to re-write the code. There are,
however, changes between 2.0 and 1.1, so you may have to rewrite some
code. I have not used the inline approach, i have used the code behind
model, so I am not sure if what i say next will apply. But I had some
1.1 code that i brought into a 2.0 project and tried to compile but
with errors because some of the coding techniques i used were now
obsolete, and the compiler recommended what to do instead.
I have heard that also.
I will have to do extensive testing before I attempt it.
So, the 1.1 to 2.0 conversion isn't guaranteed to not have any code
rewriting, but for non-obsolete code it should work fine with VS2005.
I know there is a conversion wizard that will help you convert all of
the existing code, but I believe that is for project based applications
with code-behind, but it may apply to inline files as well, I have not
tried.

Also, I think the part where it talks about the inserting of script
block and that is this: the code automatically goes into the script
block, but i believe there are 2 different views for looking at the
aspx source. One of them is HTML view which shows all of the html and
the script blocks, and then i think there is a code view, which shows
only the <script> blocks, but as i have not tried it i cannot guarantee
that's how it is.
I think what it does is exactly how I write my pages.

It knows where the script block is so it can logically separate the HTML
from the Script.

Here is how I write a Code inside page:
*************** *************** *************** *************** ***************
<%@ Page Language="VB" trace="false" debug="true" ContentType="te xt/html"
ResponseEncodin g="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ Import Namespace="Syst em.Data" %>
<%@ Import Namespace="Syst em.Data.SqlClie nt" %>
<%@ Import Namespace="MyFu nctions" %>
<script runat="server">
Sub Page_Load(s as Object, e as EventArgs)
if not IsPostBack then
call FillDrops()
end if
end sub

Sub FillDrops()
Dim myDbObject as new DbObject()
Dim DBReader As SqlDataReader

Dim parameters As SqlParameter () = { _
New SqlParameter("@ Users",SqlDbTyp e.BigInt) }

parameters(0).v alue = Session("User1" )

dbReader = myDbObject.RunP rocedure("GetCo untries", parameters)
exit sub
Country.DataSou rce=dbReader
Country.DataTex tField= "CountryNam e"
Country.DataVal ueField="Countr yCode"
Country.databin d()
Country.Items.I nsert(0, "Select Country")
end Sub
</script>
<html>
<head>
<title>:: Staffing Workshop ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../../final-site/option2/css/staffing.css" rel="stylesheet "
type="text/css">

<style type="text/css">
<!--
body {
margin-top: 5px;
}
..style5 {font-size: 9px}
..style7 {
color: #FFFFFF;
font-weight: bold;
}
-->
</style>
</head>

<body id="myBody" runat="server">
<form runat="server">
<table width="851" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td>_
<asp:DropDownLi st ID="Country" runat="server" /> </td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</form>
</body>
</html>
*************** *************** *************** *************** *************** *
*

Complete separation. I absolutely do not mix my script code with my HTML
code.
As for the comparison to ASP, I think that is correct, depending on how
you set up your ASP page. Similar to the <script> blocks, a developer
could have just encapsulated all of the code between <% %> blocks at
the beginning of the page, and then called the sub routines and
functions throughout the page. This lead to "spaghetti code", but I
think in some aspects that still exists in .NET, even with a
code-behind model.
Actually, the only place I use the <% %> is in datagrids or some place where
I need to get data from a database container such as when I Databind to a
datagrid and need to use a template column in place of a BoundColumn, which
I find much more flexible and easier to manipulate. But this would be the
same in the Code Behind model.

*************** *************** *************** *************** *************
<asp:DataGrid
Visible=true
AllowSorting="f alse"
AutoGenerateCol umns="false"
CellPadding="0"
CellSpacing="0"
ID="DataGrid1"
runat="server"
ShowFooter="fal se"
ShowHeader="tru e"
GridLines="Both "
Width="650px" style="border-collapse:separa te">
<alternatingite mstyle BackColor="#FFF FFF"/>
<itemstyle BackColor="#E9E 9E9" ForeColor="#000 0FF"/>
<headerstyle CssClass="jay" BackColor="#000 000" ForeColor="#FFF FFF"
Font-Bold="true" />
<pagerstyle BackColor="whit e" />
<columns>
<asp:TemplateCo lumn Visible="true" HeaderText="Nam e"
ItemStyle-Font-Bold="true"
ItemStyle-Width="125px" HeaderStyle-Width="125px"
ItemStyle-VerticalAlign=" middle">
<itemtemplate >
<asp:LinkButt on ID="FullName" Text='<%#
Container.DataI tem("FullName") %>' OnClick="GetApp licantDetails_C lick"
runat="server"/>
</itemtemplate>
</asp:TemplateCol umn>
</columns>
</asp:DataGrid>
*************** *************** *************** *************** ************
All in all i guess it all comes down to preference, and I guess that is
why Microsoft supports both methods, and I personally can see
advantages within each method (I admit, sometimes I get bothered having
to open the code-behind for the page).

The interesting thing is that it is not just what MS supports, but is what
it now defaults to, apparently.

Thanks,

Tom Regards,
Darren Kopp

Feb 18 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3330
by: davidshook | last post by:
I am a begginer with not too much time on my hand. I do some html pages with Dreamweaver and with some minor Flash actionscript and I have a minor ability (with the help of lots of tutorials) to do some PHP. I love Dreamweaver MX since it realy simplifies the visual part of the process of making a page and also help with code typos since it generates alot of the basic code automatically (for example, I don't have to know how to write a...
11
2820
by: jm | last post by:
Somebody on here recommended Dreamweaver with PHP. I am coming from (still using really) ASP and ASP.NET. PHP is more like ASP and not a whole lot like .net, but I wanted to know how Dreamweaver will help me with PHP. Is it easier to make a website "prettier" with Dreamweaver? Just need guidance on why to use Dreamweaver with PHP. I am using HTML kit or notepad and, of course, Google. Usually use the languages and objects for hitting...
0
2289
by: Gregory | last post by:
I am using OS X and Dreamweaver MX. I am trying to make a connection to the MySQL Server from within Dreamweaver using the Applications panel and clicking on the "+". A window opens asking for: Connection Name: Apress MySQL Server: localhost User Name: apress Password: xxxxxx Database (Select): When I click select so the Dreamweaver can browse to the databases in MySQL the connection is not being made because Dreamweaver cannot find
3
2574
by: Richard Lawson | last post by:
I am working on a site which is written in Dreamweaver. Is it possible to write pages in ASP inside of a Dreamweaver site? Rich
5
1956
by: I.P. Freely | last post by:
Hi, I've been using Visual Studio.NET for a while to design WinForms and Console apps and love it. Recently I had to a WebForms app. Because I have no artistic skill whatsoever, I enlisted the help of one of our web designers. She's a DreamWeaver expert, but I insisted that she use Visual Studio because I was under the mistaken impression that DW doesn't support WebForms, Visual Source Safe, and the other essential features that are...
0
4449
by: Zorba.GR | last post by:
Macromedia Dreamweaver MX 2004 v7.0.1 Incl Keymaker, and Addons, other Workhouseboys Design The Transmitter Buttons v1.0 for Dreamweaver MX WebAssist WA eCommerce Suite v2.01 RETAIL for Macromedia DreamWeaver MX WebAssist eCart v2.01 RETAIL for Macromedia DreamWeaver MX Apress Dreamweaver Developers Instant Troubleshooter eBook
1
1277
by: E. Wise | last post by:
I'm seeking some solid information on how I as a programmer can work with a Macromedia designer on my ASP .NET applications. Here's the specific scenario: Company has a intranet area that is standard html made in dreamweaver, this is all maintained by another person. Currently, I have 7 or so different asp .net applications that are inserted into the dreamweaver sites using floating frames. Ideally we would like to be able to throw...
4
1680
by: Ian | last post by:
Hi there, Has anybody got any tips or recommendations for using Vs.Net and Dreamweaver 2004 together? I like to use dreamweaver as the layout tool as for me it just seems a little more powerful but Vs.Net is the best for coding.. Any advice for anybody with tips or pitfalls to watchout for would be gratefully appreciated
171
7797
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles) like it because you can split the code from the design. That is logical. But if you are the only one working on the code, it seem a little overkill. I use Dreamweaver to do my design and find it a bit of a hassle to have multiple files open...
4
1711
by: Adam Knight | last post by:
Hi all, I am using a dreamweaver template for a web app i am working on. Each time i update the template my page directives at the top of the associated pages gets removed. Anyone had problems with this? Know how to fix? Fill me in on what is going on?
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5404
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5539
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.