469,964 Members | 1,483 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,964 developers. It's quick & easy.

ASP code does not process in ASP.NET

I have an asp.net webform. When I view the page in the web browser, the html
is returned but not any asp code, i.e., " <% ... %> ".

This same code works in the "old" asp page BUT NOT in asp.net.
See code below:

__________________________________________________ _______________-

<form action="intro2.aspx" method="post">
<h3>Name: <input id="Name" type="text"> Category:

<select id="Category" size="1">
<option>psychology</option>
<option>business</option>
<option>popular_comp</option>
</select>

</h3><input type="submit" value="Lookup">
<p>

<% Dim I As Integer
For I = 0 to 7 %>
<font size="<%=I%>">Welcome to ASP.NET </font>
<br>
<% Next %>

</form>

__________________________________________________ ___________
Nov 19 '05 #1
6 1274
I have a Ferrari. I took the engine out of my Volkswagon and put it in the
Ferrari. Now the Ferrari doesn't run. Why doesn't my Ferrari run with a
Volkswagon engine?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"leonat" <le****@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com...
I have an asp.net webform. When I view the page in the web browser, the
html
is returned but not any asp code, i.e., " <% ... %> ".

This same code works in the "old" asp page BUT NOT in asp.net.
See code below:

__________________________________________________ _______________-

<form action="intro2.aspx" method="post">
<h3>Name: <input id="Name" type="text"> Category:

<select id="Category" size="1">
<option>psychology</option>
<option>business</option>
<option>popular_comp</option>
</select>

</h3><input type="submit" value="Lookup">
<p>

<% Dim I As Integer
For I = 0 to 7 %>
<font size="<%=I%>">Welcome to ASP.NET </font>
<br>
<% Next %>

</form>

__________________________________________________ ___________

Nov 19 '05 #2


"Kevin Spencer" wrote:
I have a Ferrari. I took the engine out of my Volkswagon and put it in the
Ferrari. Now the Ferrari doesn't run. Why doesn't my Ferrari run with a
Volkswagon engine?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"leonat" <le****@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com...
I have an asp.net webform. When I view the page in the web browser, the
html
is returned but not any asp code, i.e., " <% ... %> ".

This same code works in the "old" asp page BUT NOT in asp.net.
See code below:

__________________________________________________ _______________-

<form action="intro2.aspx" method="post">
<h3>Name: <input id="Name" type="text"> Category:

<select id="Category" size="1">
<option>psychology</option>
<option>business</option>
<option>popular_comp</option>
</select>

</h3><input type="submit" value="Lookup">
<p>

<% Dim I As Integer
For I = 0 to 7 %>
<font size="<%=I%>">Welcome to ASP.NET </font>
<br>
<% Next %>

</form>

__________________________________________________ ___________

This asp CODE does not work either. Only the HTML code is returned.


See Code below

__________________________________________________ ___________

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm5.aspx.vb"

Inherits="WebApplicationLPM.WebForm5"%>

<script language="VB" runat="server">

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

Dim MyConnection As New
System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=pubs;Data
Source=CGLA;Trusted_Connection=yes")

Dim MyCommand As New System.Data.SqlClient.SqlCommand("select * from
Authors", MyConnection)

MyConnection.Open()

Dim dr As System.Data.SqlClient.SqlDataReader =
MyCommand.ExecuteReader()

MyDataGrid.DataSource = dr

MyDataGrid.DataBind()

MyConnection.Close()

End Sub

</script>

'_________________________________________________ ___________________-
<HTML>

<body>

<h3><font face="Verdana">Simple Select to a DataGrid Control</font></h3>

<ASP:DataGrid id="MyDataGrid" runat="server" Width="700"
BackColor="#ccccff" BorderColor="black" ShowFooter="false" CellPadding="3"
CellSpacing="0" Font-Name="Verdana" Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd" EnableViewState="false" />

</body>

</HTML>

__________________________________________________ __________

Nov 19 '05 #3
This asp.net CODE does not work either. Only the HTML code is returned.
See Code below

__________________________________________________ ___________

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm5.aspx.vb"

Inherits="WebApplicationLPM.WebForm5"%>

<script language="VB" runat="server">

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

Dim MyConnection As New
System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=pubs;Data
Source=CGLA;Trusted_Connection=yes")

Dim MyCommand As New System.Data.SqlClient.SqlCommand("select * from
Authors", MyConnection)

MyConnection.Open()

Dim dr As System.Data.SqlClient.SqlDataReader =
MyCommand.ExecuteReader()

MyDataGrid.DataSource = dr

MyDataGrid.DataBind()

MyConnection.Close()

End Sub

</script>

'_________________________________________________ ___________________-
<HTML>

<body>

<h3><font face="Verdana">Simple Select to a DataGrid Control</font></h3>

<ASP:DataGrid id="MyDataGrid" runat="server" Width="700"
BackColor="#ccccff" BorderColor="black" ShowFooter="false" CellPadding="3"
CellSpacing="0" Font-Name="Verdana" Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd" EnableViewState="false" />

</body>

</HTML>

__________________________________________________ __________

"Kevin Spencer" wrote:
I have a Ferrari. I took the engine out of my Volkswagon and put it in the
Ferrari. Now the Ferrari doesn't run. Why doesn't my Ferrari run with a
Volkswagon engine?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"leonat" <le****@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com...
I have an asp.net webform. When I view the page in the web browser, the
html
is returned but not any asp code, i.e., " <% ... %> ".

This same code works in the "old" asp page BUT NOT in asp.net.
See code below:

__________________________________________________ _______________-

<form action="intro2.aspx" method="post">
<h3>Name: <input id="Name" type="text"> Category:

<select id="Category" size="1">
<option>psychology</option>
<option>business</option>
<option>popular_comp</option>
</select>

</h3><input type="submit" value="Lookup">
<p>

<% Dim I As Integer
For I = 0 to 7 %>
<font size="<%=I%>">Welcome to ASP.NET </font>
<br>
<% Next %>

</form>

__________________________________________________ ___________


Nov 19 '05 #4
I saw it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"leonat" <le****@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...


"Kevin Spencer" wrote:
I have a Ferrari. I took the engine out of my Volkswagon and put it in
the
Ferrari. Now the Ferrari doesn't run. Why doesn't my Ferrari run with a
Volkswagon engine?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"leonat" <le****@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com...
>I have an asp.net webform. When I view the page in the web browser, the
>html
> is returned but not any asp code, i.e., " <% ... %> ".
>
> This same code works in the "old" asp page BUT NOT in asp.net.
>
>
> See code below:
>
> __________________________________________________ _______________-
>
> <form action="intro2.aspx" method="post">
> <h3>Name: <input id="Name" type="text"> Category:
>
> <select id="Category" size="1">
> <option>psychology</option>
> <option>business</option>
> <option>popular_comp</option>
> </select>
>
> </h3><input type="submit" value="Lookup">
> <p>
>
> <% Dim I As Integer
> For I = 0 to 7 %>
> <font size="<%=I%>">Welcome to ASP.NET </font>
> <br>
> <% Next %>
>
> </form>
>
> __________________________________________________ ___________
>
>

This asp CODE does not work either. Only the HTML code is returned.


See Code below

__________________________________________________ ___________

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm5.aspx.vb"

Inherits="WebApplicationLPM.WebForm5"%>

<script language="VB" runat="server">

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

Dim MyConnection As New
System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=pubs;Data
Source=CGLA;Trusted_Connection=yes")

Dim MyCommand As New System.Data.SqlClient.SqlCommand("select *
from
Authors", MyConnection)

MyConnection.Open()

Dim dr As System.Data.SqlClient.SqlDataReader =
MyCommand.ExecuteReader()

MyDataGrid.DataSource = dr

MyDataGrid.DataBind()

MyConnection.Close()

End Sub

</script>

'_________________________________________________ ___________________-
<HTML>

<body>

<h3><font face="Verdana">Simple Select to a DataGrid Control</font></h3>

<ASP:DataGrid id="MyDataGrid" runat="server" Width="700"
BackColor="#ccccff" BorderColor="black" ShowFooter="false" CellPadding="3"
CellSpacing="0" Font-Name="Verdana" Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd" EnableViewState="false" />

</body>

</HTML>

__________________________________________________ __________

Nov 19 '05 #5
>> This asp.net CODE does not work either. Only the HTML code is returned.

Does the page have a ".aspx" extension? Are you requesting it via HTTP? Is
ASP.Net registered on your machine?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"leonat" <le****@discussions.microsoft.com> wrote in message
news:62**********************************@microsof t.com...
This asp.net CODE does not work either. Only the HTML code is returned.


See Code below

__________________________________________________ ___________

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm5.aspx.vb"

Inherits="WebApplicationLPM.WebForm5"%>

<script language="VB" runat="server">

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

Dim MyConnection As New
System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=pubs;Data
Source=CGLA;Trusted_Connection=yes")

Dim MyCommand As New System.Data.SqlClient.SqlCommand("select *
from
Authors", MyConnection)

MyConnection.Open()

Dim dr As System.Data.SqlClient.SqlDataReader =
MyCommand.ExecuteReader()

MyDataGrid.DataSource = dr

MyDataGrid.DataBind()

MyConnection.Close()

End Sub

</script>

'_________________________________________________ ___________________-
<HTML>

<body>

<h3><font face="Verdana">Simple Select to a DataGrid Control</font></h3>

<ASP:DataGrid id="MyDataGrid" runat="server" Width="700"
BackColor="#ccccff" BorderColor="black" ShowFooter="false" CellPadding="3"
CellSpacing="0" Font-Name="Verdana" Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd" EnableViewState="false" />

</body>

</HTML>

__________________________________________________ __________

"Kevin Spencer" wrote:
I have a Ferrari. I took the engine out of my Volkswagon and put it in
the
Ferrari. Now the Ferrari doesn't run. Why doesn't my Ferrari run with a
Volkswagon engine?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"leonat" <le****@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com...
>I have an asp.net webform. When I view the page in the web browser, the
>html
> is returned but not any asp code, i.e., " <% ... %> ".
>
> This same code works in the "old" asp page BUT NOT in asp.net.
>
>
> See code below:
>
> __________________________________________________ _______________-
>
> <form action="intro2.aspx" method="post">
> <h3>Name: <input id="Name" type="text"> Category:
>
> <select id="Category" size="1">
> <option>psychology</option>
> <option>business</option>
> <option>popular_comp</option>
> </select>
>
> </h3><input type="submit" value="Lookup">
> <p>
>
> <% Dim I As Integer
> For I = 0 to 7 %>
> <font size="<%=I%>">Welcome to ASP.NET </font>
> <br>
> <% Next %>
>
> </form>
>
> __________________________________________________ ___________
>
>


Nov 19 '05 #6
I got it to work.

I registered the aspnet_regiis.exe -i
"Kevin Spencer" wrote:
This asp.net CODE does not work either. Only the HTML code is returned.


Does the page have a ".aspx" extension? Are you requesting it via HTTP? Is
ASP.Net registered on your machine?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"leonat" <le****@discussions.microsoft.com> wrote in message
news:62**********************************@microsof t.com...
This asp.net CODE does not work either. Only the HTML code is returned.


See Code below

__________________________________________________ ___________

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="WebForm5.aspx.vb"

Inherits="WebApplicationLPM.WebForm5"%>

<script language="VB" runat="server">

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Put user code to initialize the page here

Dim MyConnection As New
System.Data.SqlClient.SqlConnection("Provider=SQLO LEDB.1;Integrated
Security=SSPI;Persist Security Info=False;Initial Catalog=pubs;Data
Source=CGLA;Trusted_Connection=yes")

Dim MyCommand As New System.Data.SqlClient.SqlCommand("select *
from
Authors", MyConnection)

MyConnection.Open()

Dim dr As System.Data.SqlClient.SqlDataReader =
MyCommand.ExecuteReader()

MyDataGrid.DataSource = dr

MyDataGrid.DataBind()

MyConnection.Close()

End Sub

</script>

'_________________________________________________ ___________________-
<HTML>

<body>

<h3><font face="Verdana">Simple Select to a DataGrid Control</font></h3>

<ASP:DataGrid id="MyDataGrid" runat="server" Width="700"
BackColor="#ccccff" BorderColor="black" ShowFooter="false" CellPadding="3"
CellSpacing="0" Font-Name="Verdana" Font-Size="8pt"
HeaderStyle-BackColor="#aaaadd" EnableViewState="false" />

</body>

</HTML>

__________________________________________________ __________

"Kevin Spencer" wrote:
I have a Ferrari. I took the engine out of my Volkswagon and put it in
the
Ferrari. Now the Ferrari doesn't run. Why doesn't my Ferrari run with a
Volkswagon engine?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"leonat" <le****@discussions.microsoft.com> wrote in message
news:D4**********************************@microsof t.com...
>I have an asp.net webform. When I view the page in the web browser, the
>html
> is returned but not any asp code, i.e., " <% ... %> ".
>
> This same code works in the "old" asp page BUT NOT in asp.net.
>
>
> See code below:
>
> __________________________________________________ _______________-
>
> <form action="intro2.aspx" method="post">
> <h3>Name: <input id="Name" type="text"> Category:
>
> <select id="Category" size="1">
> <option>psychology</option>
> <option>business</option>
> <option>popular_comp</option>
> </select>
>
> </h3><input type="submit" value="Lookup">
> <p>
>
> <% Dim I As Integer
> For I = 0 to 7 %>
> <font size="<%=I%>">Welcome to ASP.NET </font>
> <br>
> <% Next %>
>
> </form>
>
> __________________________________________________ ___________
>
>


Nov 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Paul Cochrane | last post: by
2 posts views Thread by Guadala Harry | last post: by
18 posts views Thread by Joe Fallon | last post: by
171 posts views Thread by tshad | last post: by
4 posts views Thread by David | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.