Solved

Calling a class sub from HTML OnItemDataBound

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 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