SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 46 of 46
  1. #26
    Shaf
    SitePoint Community Guest
    Databinding to Repeater control is too basic, any level of developer can do. For mixed controls inside repeater you will need to use loop to retrieve any control values.

    e.g.
    Dim X As Long

    For X = 0 To Repeater1.Items.Count - 1
    Dim MyValue As TextBox = Repeater1.Items(X).FindControl("textbox1")
    MyValue.Text = MyValue.Text.ToString()
    Next

    Hope this help.

    Cheers
    Shaf

  2. #27
    Crypth
    SitePoint Community Guest
    Thanks alot Shaf, after mucking about for some time, i did what you just pointed out, consuming the event "OnItemDataBound" and then setting the items value. However what i, after writing a lot of unecessary code, noticed is that you simply need to use the following syntax:

    asp:HyperLink class="text"
    NavigateUrl='<%# "mainframeset.aspx?CatType=" +
    DataBinder.Eval(Container.DataItem,"Sub_Category_ID")%>"
    Text="<%#DataBinder.Eval(Container.DataItem, "Sub_Category_Text")%>'
    runat="server" target="mainFrame" ID="Hyperlink1" NAME="Hyperlink1"/>

    Since apparantly, within properties of the objects, you need to use the ' character instead of " (most likely because the ability to use " within the <% %> tags and the developers got tired of messing about with """,""" for a simple "," in their code :D)

  3. #28
    SitePoint Guru pufa's Avatar
    Join Date
    Oct 2004
    Location
    Portugal, Lisboa
    Posts
    947
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Instead of :
    NavigateUrl='<%# "mainframeset.aspx?CatType=" + DataBinder.Eval(Container.DataItem,"Sub_Category_ID")%>"

    You can use another overload of DataBinder.Eval

    <%# DataBinder.Eval(Container.DataItem, "Sub_Category_ID", "mainframeset.aspx?CaType={0}") %>, much cleaner.

    {0}, gets replacled with the value of "Sub_Category_ID", and DataBinder.Eval returns

    mainframeset.aspx?CatType=Sub_Category_ID_Value
    Ciao, Rui...

  4. #29
    Ujjwal Srivastava
    SitePoint Community Guest
    I used the code given above for Repeater control and it really worked and solved my probel. Thanks a lot as this code is absolutely correct and work.

  5. #30
    Smart Guy
    SitePoint Community Guest
    You spelled Separator Wrong when providing the <SeparatorTemplate> property

  6. #31
    jadeja indravijay
    SitePoint Community Guest
    I was learning the use of the Repetor, i m Freahar, this page solved all the confusion in my mind, i would just say this is the optimam guide...

  7. #32
    Jean
    SitePoint Community Guest
    Great job!!! This helped a lot. I've been able to use it in my programs. Keep up with th good job.
    Thanks...

  8. #33
    Angsuman Roy
    SitePoint Community Guest
    It helped me a lot in understanding repeater control

  9. #34
    unknown
    SitePoint Community Guest
    nice

  10. #35
    izabel
    SitePoint Community Guest
    Thanks for your sample. However i got some problems to display reader data. Maybe because I'm new to all this stuff. Here's the way i did to display data using the repeater. Hope it helps save some time to someone.

    <ItemTemplate>
    <tr>
    <td><%#((System.Data.DataRowView)Container.DataItem).Row["fieldNameToDisplay"]%></td>
    </tr>
    </ItemTemplate>

  11. #36
    subrahmanyam
    SitePoint Community Guest
    good

  12. #37
    Anonymous
    SitePoint Community Guest
    good...

  13. #38
    sreenivas
    SitePoint Community Guest
    excellent

    bangalore

  14. #39
    Mike Kingscott
    SitePoint Community Guest
    Concatenating the content in the NavigateUrl has just saved me a heap of work - thank you!

  15. #40
    sunil
    SitePoint Community Guest
    Nice

  16. #41
    natesh
    SitePoint Community Guest
    good

  17. #42
    dig
    SitePoint Community Guest
    good its very helpful

  18. #43
    Arvind Yadav
    SitePoint Community Guest
    This gives an Html error while running,Is does not give an error if
    NavigateUrl="<%# "mainframeset.aspx?CatType=" +
    DataBinder.Eval(Container.DataItem,"Sub_Category_ID")%>"


    and

    Text="<%#DataBinder.Eval(Container.DataItem, "Sub_Category_Text")%>"

    are taken within single quotes.

  19. #44
    Rupam
    SitePoint Community Guest
    Good but I want more brief about the control

    Thanks

  20. #45
    Adrian
    SitePoint Community Guest
    Hi there,

    Great article - just what I needed, thanks!

  21. #46
    yamini
    SitePoint Community Guest
    hi
    i have taken datalist .in that item template i have taken hyperlink .then i want to bind two columns in text property of hyperlink


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •