Reset Function variable after Repeater control is finished

S

sck10

Hello,

I have 3 repeater controls referencing the same function below. What it is
doing is testing to see if the first column repeats itself and if so, add a
line with the managers name. The problem I have is how to reset
"strBlankRow" after each repeater control is finished.

Thanks, sck10



<asp:Literal id="ltrNewLine" text='<%# BlankRow(Eval("FinalApprovalHandle"))
%>' runat="server"></asp:Literal>


Function BlankRow(ByVal strRepeaterValue As String) As String
If strBlankRow <> strRepeaterValue Then
strBlankRow = strRepeaterValue
strReturn = "<tr><td class=BlueB height=25px width=95% colspan=9
valign=bottom><br />" & _
strRepeaterValue & "</td></tr>"
Return strReturn
Else
strBlankRow = strRepeaterValue
Return Nothing
End If

End Function
 
W

Walter Wang [MSFT]

Hi sck10,

Repeater has an event named ItemDataBound, which is fired whenever an item
is bound to the data. You can reset the field "strBlankRow" in this event.

This is what I think should work for your first statement "what it is doing
is testing to see if the first column repeats itself". However, according
to your second statement "how to reset after each repeater control is
finished", I think you need to reset the field in Repeater's another event
"DataBinding".

Hope this helps. Please feel free to post here if anything is unclear.

Sincerely,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top