473,379 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

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 3973
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********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.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********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.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********@gmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.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="text/html"
ResponseEncoding="iso-8859-1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="MyFunctions" %>
<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",SqlDbType.BigInt) }

parameters(0).value = Session("User1")

dbReader = myDbObject.RunProcedure("GetCountries", parameters)
exit sub
Country.DataSource=dbReader
Country.DataTextField= "CountryName"
Country.DataValueField="CountryCode"
Country.databind()
Country.Items.Insert(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:DropDownList 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="false"
AutoGenerateColumns="false"
CellPadding="0"
CellSpacing="0"
ID="DataGrid1"
runat="server"
ShowFooter="false"
ShowHeader="true"
GridLines="Both"
Width="650px" style="border-collapse:separate">
<alternatingitemstyle BackColor="#FFFFFF"/>
<itemstyle BackColor="#E9E9E9" ForeColor="#0000FF"/>
<headerstyle CssClass="jay" BackColor="#000000" ForeColor="#FFFFFF"
Font-Bold="true" />
<pagerstyle BackColor="white" />
<columns>
<asp:TemplateColumn Visible="true" HeaderText="Name"
ItemStyle-Font-Bold="true"
ItemStyle-Width="125px" HeaderStyle-Width="125px"
ItemStyle-VerticalAlign="middle">
<itemtemplate>
<asp:LinkButton ID="FullName" Text='<%#
Container.DataItem("FullName")%>' OnClick="GetApplicantDetails_Click"
runat="server"/>
</itemtemplate>
</asp:TemplateColumn>
</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
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...
11
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...
0
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:...
3
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
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...
0
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...
1
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...
4
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...
171
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)...
4
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.