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

  • Thread starter Mr. SweatyFinger
  • 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>
 
M

Michael Nemtsev

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
 
S

Smokey Grindel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top