CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 8/7/2005 4:47:59 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 17 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
Ruffone
Asp.Net User
CustomRepeater control8/7/2005 4:47:59 PM

0/0

I am building a custom repeater control that wraps it's content in parentheses based on conditions. It is work somewhat. It works perfectly if my template does not contain controls but if I were to add controls to the template (LinkButtons/TextBox)  then the controls are never wrapped in the parentheses. Examples of the templates and the code is below. Could anyone tell me why this happens and how I might do this so that my controles will be rendered enclosed in parentheses.

This works perfectly
      <itemtemplate>
         <%# Eval("Name") %>
      </itemtemplate>

With this I get nothing
      <itemtemplate>
        <asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Eval("Name") %>' /> 
      </itemtemplate>


    Public Class MyRepeater
        Inherits Repeater

        Protected Overrides Sub RenderChildren(ByVal writer As System.Web.UI.HtmlTextWriter)
            Dim YItems, NItems, CItems As Collection
            Dim parenOpen As New LiteralControl
            parenOpen.Text = " ("
            Dim parenClose As New LiteralControl
            parenClose.Text = ")"
            YItems = New Collection
            NItems = New Collection

            For Each control As Web.UI.Control In Controls
                Dim strWriter As New IO.StringWriter
                Dim htmlWriter As New HtmlTextWriter(strWriter)
                control.RenderControl(htmlWriter)
                Dim strBuilder As Text.StringBuilder
                strBuilder = strWriter.GetStringBuilder

                Dim strItem As String = strBuilder.ToString()
                strItem = strItem.Trim()
                Select Case strItem.Substring(strItem.Length - 1)
                    Case "Y"
                        YItems.Add(strItem.Substring(0, strItem.Length - 2))
                    Case "N"
                        NItems.Add(strItem.Substring(0, strItem.Length - 2))
                    Case Else
                        NItems.Add(strItem)
                End Select
            Next

            RenderControls(NItems, writer)
            If YItems.Count > 0 Then
                parenOpen.RenderControl(writer)
                RenderControls(YItems, writer)
                parenClose.RenderControl(writer)

            End If

        End Sub

        Private Sub RenderControls(ByVal items As Collection, ByVal writer As System.Web.UI.HtmlTextWriter)

        End Sub
    End Class

Luis Abreu
Asp.Net User
Re: CustomRepeater control8/8/2005 9:18:17 PM

0/0

Hello.
not really sure on what you're trying to do, but have you debugged the code? maybe that'll help you understand what's going on...
--
Regards,
Luis Abreu
email: labreu_at_gmail.com
PT blog: http://weblogs.pontonetpt.com/luisabreu
EN blog:http://msmvps.com/blogs/luisabreu
http://www.pontonetpt.com
http://weblogs.pontonetpt.com/
Ruffone
Asp.Net User
Re: CustomRepeater control8/9/2005 9:01:13 AM

0/0

This is a ClassLibrary, setting a brake point is never triggered since by then it's compiled into a dll. Could I set a brake point in a dll?
BrockAllen
Asp.Net User
Re: CustomRepeater control8/9/2005 3:47:18 PM

0/0

Yes you can. Make sure it's compiled in debug mode, and add its project into your solution for your web project.

-Brock

DevelopMentor
http://staff.develop.com/ballen
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Using templates with custom repeater control [Archive] - DevX.com ... [Archive] Using templates with custom repeater control ASP.NET.
Creating Rich Repeater Control By Hendrik Swanepoel A good custom repeater control isn't limited to having only search .... Visible) { //get a reference to the container control CustomRepeater cr ...
Custom Repeater Control - ASP - Web Development Hi People,I have a bit of a problem and hope someone can help me or point in the right direction.Basically I have created a custom control which is just ...
Custom Repeater Control? - ASP.NET Forums Is there a way for me to create a custom repeater control that would include the UI and databinding? Is there a better way to achieve this? ...
Custom Repeater control - ASP.NET Forums Custom Repeater control. Last post 12-22-2004 3:28 AM by mattyblah. 5 replies. Sort Posts:. Oldest to newest, Newest to oldest ...
Control.ChildControlsCreated Property (System.Web.UI) The following example demonstrates an override of the OnDataBinding method of a custom Repeater control. To ensure that child controls are not created until ...
CodeProject: A Grouping Repeater Control for ASP.NET. Free source ... This custom repeater control can be used to add group headers to your output.; Author: Rob van der Veer; Section: Custom Controls; Chapter: Web Development.
The Basics of Templates in Server Controls: ASP Alliance The only difference is that there is a control called CustomRepeater. It is quite obvious it is a custom control that derives from the Repeater control: ...
How do I get custom ITemplate to be recognized. I created a custom Repeater control that works basically just like the standard Repeater control and it works fine. ...
ASP.NET Custom Repeater templates, drop down lists, and events not ... Jun 18, 2008 ... Custom Repeater templates, drop down lists, and events not firing ... Each of the items (sub-pages) in the repeater control is also built ...




Search This Site:










lost passwords in 3.0.13 to 3.1.1 update

aspnetdb.mdf in app_data directory marked read only

which project to use to build user control

from asp classic to asp.net 2.0

best document management module

controling cascading style sheet load order (cascades) with asp.net 2.0 themes

smart client ffline application block

login converted to template c#(vs2005)

opening msword and excel on users machine.

about portal expiry date

cookie problem

server setup and use

dnn 2.0.2b3 still a few bugs

object reference not set to an instance of an object, no clue why

visual studio just-in-time debugger

wysiwyg editors

windows authentication

help needed to check 2 usernames to proceed.

web forms security via web.config?

vs 2003 class design

help !!! on excel and login page

help - asp.net config

connect buyer and seller on web site

how to convert iso-8859-1 to utf-8

treeview check event

dnn3 - show all files in a folder?

pathing with masterpages nightmare

how to remove readonly attribute of a folder .

how to authorize a credit card using asp.net

vwd express - could not find schema information for the attribute/element

 
All Times Are GMT