Solved

Calling a class sub from HTML OnItemDataBound

Posted on 2014-10-16
3
112 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:mwmiller78
  • 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:mwmiller78
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

776 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