Solved

Calling a class sub from HTML OnItemDataBound

Posted on 2014-10-16
3
116 Views
Last Modified: 2014-11-13
I have a repeater control in which I call a subroutine using

OnItemDataBound="getNestedMenuData"

Open in new window


in which is:

    Sub getNestedMenuData(ByVal Sender As Object, ByVal e As RepeaterItemEventArgs)
        Dim lblSubYN As New Label
        lblSubYN = e.Item.FindControl("lblSub")       
        'do stuff with e
    End Sub

Open in new window


Is there any way I can do this same thing but call a sub from a class page instead of code behind?
I can't seem to get the value of e to pass.
Example?

TIA
0
Comment
Question by:Mike Miller
[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 83

Expert Comment

by:CodeCruiser
ID: 40391734
Not sure I understand the question. Can you explain and show more code?
0
 

Author Comment

by:Mike Miller
ID: 40397713
Right now I have

OnItemDataBound="getNestedMenuData"

Open in new window


on the HTML side.

Here is the code behind for that page...

    Sub getNestedMenuData(ByVal Sender As Object, ByVal e As RepeaterItemEventArgs)
        GenerateSubMenu(e)
    End Sub

Open in new window


And here is the class page for my application

    Public Sub GenerateSubMenu(ByVal e As RepeaterItemEventArgs)
'do stuff
    End Sub

Open in new window


I'm just trying to eliminate the code behind call and just call what is on the class page from the HTML
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 40412085
If you don't use e within GenerateSubMenu method, you can try replacing

OnItemDataBound="getNestedMenuData"

with

OnItemDataBound="GenerateSubMenu"
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

749 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