G
Guest
A basic question:
In a content page I access a TextBox from code behind with no problems
(something like Me.MyField.Text="1").
This is the portion of aspx file :
<asp:Content ID="secMessagge" ContentPlaceHolderID="cphFooter" Runat="Server">
<asp:TextBox ID="MyField" runat="server" BorderStyle="Inset"
BorderWidth="3px"
ReadOnly="True" Style="left: 485px; position: relative; top:
2px; text-align: center"
Width="52px"></asp:TextBox>
</asp:Content>
In a second Content Section of the same page I then added a GridView.
The Select command in the DataSource reference the TextBox like this:
.... SelectCommand="SELECT * FROM [Contracts] WHERE ([ContractID] =
@ContractID)" ....
<SelectParameters>
<asp:ControlParameter ControlID="MyField" Name="ContractID"
PropertyName="Text" Type="string" />
</SelectParameters>
Problem:
1 - running the page I get an error saying control MyField is not found.
2 - in programming phase, the selecting list of controls shows all controls
twice (?).
The problem is surely related to the presence of a Master page. Without it a
similar page is runnning.
Can I get some help?
Thanks.
In a content page I access a TextBox from code behind with no problems
(something like Me.MyField.Text="1").
This is the portion of aspx file :
<asp:Content ID="secMessagge" ContentPlaceHolderID="cphFooter" Runat="Server">
<asp:TextBox ID="MyField" runat="server" BorderStyle="Inset"
BorderWidth="3px"
ReadOnly="True" Style="left: 485px; position: relative; top:
2px; text-align: center"
Width="52px"></asp:TextBox>
</asp:Content>
In a second Content Section of the same page I then added a GridView.
The Select command in the DataSource reference the TextBox like this:
.... SelectCommand="SELECT * FROM [Contracts] WHERE ([ContractID] =
@ContractID)" ....
<SelectParameters>
<asp:ControlParameter ControlID="MyField" Name="ContractID"
PropertyName="Text" Type="string" />
</SelectParameters>
Problem:
1 - running the page I get an error saying control MyField is not found.
2 - in programming phase, the selecting list of controls shows all controls
twice (?).
The problem is surely related to the presence of a Master page. Without it a
similar page is runnning.
Can I get some help?
Thanks.