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

Discussion in 'ASP .Net' started by Mr. SweatyFinger, Dec 2, 2006.

  1. 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>
     
    Mr. SweatyFinger, Dec 2, 2006
    #1
    1. Advertising

  2. 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
     
    Michael Nemtsev, Dec 2, 2006
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:...
    > 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>
    >
    >
     
    Smokey Grindel, Dec 2, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George Durzi

    OnEditCommand - .FindControl Returning Null

    George Durzi, Jul 14, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    496
    George Durzi
    Jul 14, 2003
  2. Ravikanth[MVP]

    FindControl

    Ravikanth[MVP], Jul 18, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    459
    Yan-Hong Huang[MSFT]
    Jul 22, 2003
  3. James G. Beldock
    Replies:
    1
    Views:
    9,352
    Kevin Spencer
    Aug 7, 2003
  4. ThunderMusic
    Replies:
    2
    Views:
    421
    ThunderMusic
    Oct 9, 2006
  5. ThunderMusic

    WebControls and sub controls... problem with FindControl... Why?

    ThunderMusic, Oct 9, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    162
    ThunderMusic
    Oct 9, 2006
Loading...

Share This Page