473,387 Members | 1,721 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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>
Dec 2 '06 #1
2 2227
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

Mwhy why why why why why why why why why why
M>
MCan't i get
M>
Mdim PlaceHolderPrice as placeholder =
Mformview1.findcontrol("PlaceHolderPrice")
M>
M<asp:FormView ID="FormView1" runat="server" DataKeyNames="AdNum"
MDefaultMode="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"
MVisible="false">
M>
M<tr>
M>
M<td style="width: 3px;" valign="top">
M>
M</td>
M>
M<td valign="top">
M>
MPrice:
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
Dec 2 '06 #2
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
"Mr. SweatyFinger" <sw@sw1finger.comwrote in message
news:u3**************@TK2MSFTNGP04.phx.gbl...
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>


Dec 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.