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

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

Post by Mr. Sweaty » Sun, 03 Dec 2006 16:56:44


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">

 </td>

</tr>

</asp:PlaceHolder>


</table>

</editItemTemplate>

</formview>
 
 
 

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

Post by Michael Ne » Sun, 03 Dec 2006 21:00:51

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>  </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://www.yqcomputer.com/

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

 
 
 

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

Post by Smokey Gri » Mon, 04 Dec 2006 00:46:59

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