Solved

Calling a class sub from HTML OnItemDataBound

Posted on 2014-10-16
3
118 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

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

707 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