Why does't the asp.net code work

This is an ASP.Net 4.5 question with Visual Studio 2013: I have determined that the following code works if I create an empty website project in Visual Studio 2013. If I do not create an empty website then when I post a formfield from one page to another page the datalist does not display at all which I would assume because the formfield values have not been passed. Would anyone know why creating a full project in ASP.Net 4.5 would cause this to happen and how can I correct it.

Page that performs the post
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="send.aspx.vb" Inherits="send" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:TextBox ID="bodypartmg" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" PostBackUrl="~/recev.aspx" Text="Button" />
    
    </div>
    </form>
</body>
</html>

Open in new window


Page that receives the post
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="recev.aspx.vb" Inherits="recev" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SQL2008R2_504887_golivefitnesConnectionString %>" SelectCommand="sp_gettheresults" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:FormParameter FormField="bodypartmg" Name="bodypartmg" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <asp:DataList ID="DataList1" runat="server" DataSourceID="SqlDataSource1">
            <ItemTemplate>
                name:
                <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
        <br />
                bodypartmg:
                <asp:Label ID="bodypartmgLabel" runat="server" Text='<%# Eval("bodypartmg") %>' />
        <br />
                bodypartspecific:
                <asp:Label ID="bodypartspecificLabel" runat="server" Text='<%# Eval("bodypartspecific") %>' />
        <br />
                secondary_areas:
                <asp:Label ID="secondary_areasLabel" runat="server" Text='<%# Eval("secondary_areas") %>' />
        <br />
<br />
            </ItemTemplate>
        </asp:DataList>
    
    </div>
    </form>
</body>
</html>

Open in new window



WebConfig
<?xml version="1.0"?>

<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->

<configuration>
  <connectionStrings>
    
    <add name="FitnessConnectionString" connectionString="Data Source=DM-MOBILE-2014\MSSQLSVR2008;Initial Catalog=BaseCustomers;Persist Security Info=True;User ID=User1;Password=xuser12five" providerName="System.Data.SqlClient"/>
   
  </connectionStrings>  
  
  
  <system.web>
      <compilation debug="true" strict="false" explicit="true" targetFramework="4.5.1" />
      <httpRuntime targetFramework="4.5.1" />
    </system.web>

</configuration>

Open in new window

derrekdeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

saritapatelSoftware developerCommented:
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SQL2008R2_504887_golivefitnesConnectionString %>" SelectCommand="sp_gettheresults" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:FormParameter FormField="bodypartmg" Name="bodypartmg" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>

Open in new window


Change it to
    
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$  FitnessConnectionString %>" SelectCommand="sp_gettheresults" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:FormParameter FormField="bodypartmg" Name="bodypartmg" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
derrekdeveloperAuthor Commented:
Thanks for the help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.