Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Declaration Within DataList Not Working

Posted on 2009-04-13
3
Medium Priority
?
268 Views
Last Modified: 2012-05-06
I have the below datalist, and EVERYTHING is working great.  I am trying to add a SIMPLE label as you will see "lblPostedData" and call a routine on click of the button "BtnSubmit".  Basically, on the click of this button I need to post something to the label.  Problem that lies in that for some reason (odd to me, but maybe not so odd because this is the first attempt at doing this in a datalist) is that nothing seems to be declared.  So doing a simple lblPostedData.Text doesn't even work.  I sort of browsed around and found that a Repeater may work better, but same results here and would like to stick with the DataList.
<asp:DataList ID="DataList1" runat="server">
                    
                         <ItemTemplate>
                            <table style="width: 696px; height: 1px">
                                <tr>
                                    <td style="width: 548px; height: 10px; background-color: white">
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 548px; background-color: white; height: 402px;">
                                        <%# DataBinder.Eval(Container.DataItem, "Details") %>                                        
                                        <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" BasePath="/fckeditor/" Height="400px" Width="700px">
                                        </FCKeditorV2:FCKeditor>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 548px; height: 10px; background-color: white">
                                        <asp:Button ID="BtnSubmit" runat="server" OnClick="BtnSubmit_Click" Text="Submit" /></td>
                                </tr>
                                <tr>
                                    <td style="width: 548px; height: 10px; background-color: white">
                                        <asp:Label ID="lblPostedData" runat="server"></asp:Label></td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    
                    </asp:DataList>

Open in new window

0
Comment
Question by:chrisryhal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Author Comment

by:chrisryhal
ID: 24134638
FYI, I tried this with no luck either

    Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataListItemEventArgs)
        Dim mylab As Label
        mylab = e.Item.FindControl("lblPostedData")
        mylab .Text = "THIS IS A TEST"
    End Sub
0
 
LVL 14

Accepted Solution

by:
GiftsonDJohn earned 2000 total points
ID: 24135147
Hi,

Are you Binding the DataList again on the Button click event?
0
 
LVL 14

Expert Comment

by:GiftsonDJohn
ID: 24136137
Hi

Also I can't see any event handlers declaration for the function DataList1_ItemDataBound to be handled when the data is binded for DataList1
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question