For some reason VS 2008 will not recognize an html page that I have saved as aspx with new file extension. I thought this was the work-around to develop single page aspx pages, where the "code behind" in in the script tag above the content?
Someone please tell me what I need to do to create single page aspx pages.
My VS 2008 will not allow me to create a new page without it being a 2 page asp.net page with a code behind page. Do I just create one like this and then just delete the second page and change the @Page line by deleteing the "CodeBehind and Inherits" properties?
I don't think you understand. I CANNOT just create A blank aspx page. VS will not let me. It always creates the code behing page and the "designer" page. Is there anything I can set in the vs 2008 options or something else to get it to allow me to create
a ONE PAGE aspx page?
SMA49
Member
36 Points
42 Posts
Html page conversion to Aspx page in Visual Studio 2008
Mar 05, 2012 03:52 PM|LINK
For some reason VS 2008 will not recognize an html page that I have saved as aspx with new file extension. I thought this was the work-around to develop single page aspx pages, where the "code behind" in in the script tag above the content?
Someone please tell me what I need to do to create single page aspx pages.
thanks
sma
adamturner34
Contributor
4394 Points
1102 Posts
Re: Html page conversion to Aspx page in Visual Studio 2008
Mar 05, 2012 04:24 PM|LINK
You can't just change file extension. You need a Page directive header as well as a <form runat="server"> tag
The easiest way to do it is to just create a new blank .aspx page and paste the html inside the form tag.
SMA49
Member
36 Points
42 Posts
Re: Html page conversion to Aspx page in Visual Studio 2008
Mar 05, 2012 04:51 PM|LINK
I have done that.
My VS 2008 will not allow me to create a new page without it being a 2 page asp.net page with a code behind page. Do I just create one like this and then just delete the second page and change the @Page line by deleteing the "CodeBehind and Inherits" properties?
SMA
SMA49
Member
36 Points
42 Posts
Re: Html page conversion to Aspx page in Visual Studio 2008
Mar 05, 2012 04:57 PM|LINK
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="Main.Master" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Reflection" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Web.Caching" %>
<%@ Import Namespace="System.Web.SessionState " %>
<script runat="server">
</script>
adamturner34
Contributor
4394 Points
1102 Posts
Re: Html page conversion to Aspx page in Visual Studio 2008
Mar 05, 2012 05:01 PM|LINK
It's not 2 pages. It's a script page and code file. That's just an option VS uses to split the files up. It's a huge benefit compared to classic ASP.
In any event, yes you need that file but no worries.
SMA49
Member
36 Points
42 Posts
Re: Html page conversion to Aspx page in Visual Studio 2008
Mar 05, 2012 05:26 PM|LINK
I don't think you understand. I CANNOT just create A blank aspx page. VS will not let me. It always creates the code behing page and the "designer" page. Is there anything I can set in the vs 2008 options or something else to get it to allow me to create a ONE PAGE aspx page?
SMA