Hi, I use both Dreamweaver MX and VS.NET although I have never used both at the same time. I began working on a clients site which was designed in DW, basically they want some interactivity adding to it. I started by renaming the page from .html to .aspx then
used "add existing item" in VS, it asked if I wanted to create a class and I said yes. Then I tried adding ASP controls into the existing HTML table created in DW, 4 drop down lists. When I tried to run the page it said: Control 'DropDownList1' of type 'DropDownList'
must be placed inside a form tag with runat=server Am I doing this correctly by renaming the page to an .aspx? Is this the best way to import static html files into vs to convert to asp web forms? Finally should I be adding the drop downs in Dreamweaver first?
I hope someone can point me in the right direction with this. Thanks Ben
Ben Durkin
MCP MCSA MCSE, Currently learning VB.NET and ASP.NET
Hi Ben, There is no one right way to accomplish what you suggest: upgrading a static page (html) to use ASP.NET. The approach that you've taken can work but there are other ways, too. The specific message that you reported typically signifies that you've tried
to add ASP.NET server-side form controls (like dropdowns) outside a server-side form. Generally, that's not a good idea. You typically want to put a FORM tag with the RUNAT="server" attribute on the outside of all your server-side form elements. Remember,
you can only have one server-side form per page in ASP.NET. You mentioned that you've opted to add the dynamic content to the static page using VS. That's fine. You could also add dynamic content to the page using DW. It supports ASP.NET also, though the way
it handles database access, etc., is somewhat different than the approach taken by VS. Both are legitimate. VS generally opts to use code behind pages with the data access code embedded therein. DW opts to use a set of server-side tags that encapsulate database
access. Both approachs, as I said, are perfectly valid. In fact, the upcoming version of ASP.NET being developed by Microsoft (codenamed Whidbey) is introducing a set of server-side database access tags very much like those used by DW today. So, a tag-based
approach is obviously OK just like a code behind approach is. It's really your choice. If you use DW to add your dynamic functionality it will guide you through the process (creating a connection to a database, adding a dataset to the page, adding the server-side
form elements along with the server-side form tag, etc.). Best of luck with your project. Let the gang here know how it goes!
My method is the same, except I don't use VS.net at all. If the site is not too complicated then I think DW can handle ASP.net quite nicely and you don't have to worry about incompatabilities between the two.
BenDurkin200...
Member
685 Points
137 Posts
Am I using DW and VS correctly in this way?
Mar 09, 2004 09:35 PM|LINK
MCP MCSA MCSE, Currently learning VB.NET and ASP.NET
Burnley, England
DW Engineer
Member
420 Points
84 Posts
Re: Am I using DW and VS correctly in this way?
Mar 10, 2004 07:01 PM|LINK
Dreamweaver Engineer
Macromedia, Inc.
dot365
Contributor
2520 Points
504 Posts
Re: Am I using DW and VS correctly in this way?
Mar 11, 2004 06:46 PM|LINK