findcontrol("PlaceHolderPrice") why why why why why why why why why why why

  • Thread starter Thread starter Mr. SweatyFinger
  • Start date Start date
M

Mr. SweatyFinger

why why why why why why why why why why why

Can't i get

dim PlaceHolderPrice as placeholder =
formview1.findcontrol("PlaceHolderPrice")



<asp:FormView ID="FormView1" runat="server" DataKeyNames="AdNum"
DefaultMode="Edit" DataSourceID="SqlDataSource1">

<EmptyDataTemplate>



</EmptyDataTemplate>

<EditItemTemplate>

<table border="0" cellspacing="0" cellpadding="0" width="550" >

<asp:PlaceHolder ID="PlaceHolderPrice" runat="server" Visible="false">

<tr>

<td style="width: 3px;" valign="top">

</td>

<td valign="top">

Price:

</td>

<td valign="top" width="10">

$</td>

<td valign="top">

<asp:TextBox ID="PriceTextBox" runat="server" Text='<%# Bind("Price")
%>'></asp:TextBox>

td>

<td width="10">

&nbsp;</td>

</tr>

</asp:PlaceHolder>


</table>

</editItemTemplate>

</formview>
 
Hello Mr. SweatyFinger,

The reason is that you can't get the control while you are not in the template
mode
As soon you EditItemTemplate will be active findcontrol returns you your
control

M> why why why why why why why why why why why
M>
M> Can't i get
M>
M> dim PlaceHolderPrice as placeholder =
M> formview1.findcontrol("PlaceHolderPrice")
M>
M> <asp:FormView ID="FormView1" runat="server" DataKeyNames="AdNum"
M> DefaultMode="Edit" DataSourceID="SqlDataSource1">
M>
M> <EmptyDataTemplate>
M>
M> </EmptyDataTemplate>
M>
M> <EditItemTemplate>
M>
M> <table border="0" cellspacing="0" cellpadding="0" width="550" >
M>
M> <asp:PlaceHolder ID="PlaceHolderPrice" runat="server"
M> Visible="false">
M>
M> <tr>
M>
M> <td style="width: 3px;" valign="top">
M>
M> </td>
M>
M> <td valign="top">
M>
M> Price:
M>
M> </td>
M>
M> <td valign="top" width="10">
M>
M> $</td>
M>
M> <td valign="top">
M>
M> <asp:TextBox ID="PriceTextBox" runat="server" Text='<%# Bind("Price")
M> %>'></asp:TextBox>
M>
M> <td width="10">
M>
M> &nbsp;</td>
M>
M> </tr>
M>
M> </asp:PlaceHolder>
M>
M> </table>
M>
M> </editItemTemplate>
M>
M> </formview>
M>
---
WBR,
Michael Nemtsev [C# MVP] :: blog: http://spaces.live.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
 
Step 1: Get an ASP.NET book, read and learn
Step 2: Learn to solve own problems with out being a baby and crying when
you cant solve a simple problem, if you cant solve it still at that point
then ask, don't run around calling people idiots because you didn't post
detailed enough information that it takes people a while to figure out what
the heck you were trying to ask...
Step 3: grow up
 
Back
Top