473,398 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Calling a sub in a user control

Can a user control call a sub procedure in another user control ?

For example I have an aspx page with 2 user controls, header.ascx and
body.ascx I would like to be able to call a sub procedure that updates an
image in header.ascx.

Thanks

Murphy
Nov 18 '05 #1
3 1784
yes, but the procedure in header.ascx must be declare "public"

"Murphy" <mu****@murphy.com> дÈëÏûÏ¢ÐÂÎÅ
:OG*************@TK2MSFTNGP12.phx.gbl...
Can a user control call a sub procedure in another user control ?

For example I have an aspx page with 2 user controls, header.ascx and
body.ascx I would like to be able to call a sub procedure that updates an
image in header.ascx.

Thanks

Murphy

Nov 18 '05 #2
Excellent, now the million dollar question...

What is the syntax to call this public sub ?

Thanks

Murphy

"coollzh" <co*****@hotmail.com> wrote in message
news:e9**************@TK2MSFTNGP11.phx.gbl...
yes, but the procedure in header.ascx must be declare "public"

"Murphy" <mu****@murphy.com> дÈëÏûÏ¢ÐÂÎÅ
:OG*************@TK2MSFTNGP12.phx.gbl...
Can a user control call a sub procedure in another user control ?

For example I have an aspx page with 2 user controls, header.ascx and
body.ascx I would like to be able to call a sub procedure that updates an image in header.ascx.

Thanks

Murphy


Nov 18 '05 #3
From your page, the syntax would be something like this:
MyControl.MySub(MyParameters)

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
"Murphy" <mu****@murphy.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Excellent, now the million dollar question...

What is the syntax to call this public sub ?

Thanks

Murphy

"coollzh" <co*****@hotmail.com> wrote in message
news:e9**************@TK2MSFTNGP11.phx.gbl...
yes, but the procedure in header.ascx must be declare "public"

"Murphy" <mu****@murphy.com> дÈëÏûÏ¢ÐÂÎÅ
:OG*************@TK2MSFTNGP12.phx.gbl...
Can a user control call a sub procedure in another user control ?

For example I have an aspx page with 2 user controls, header.ascx and
body.ascx I would like to be able to call a sub procedure that updates an image in header.ascx.

Thanks

Murphy



Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: b.bardugo | last post by:
Hi all, I have a C# user control (a little app I made to display video). In this code I am using a third party .dll, which is written in C++ (un-managed). I am tring to put this control on a web...
2
by: Stephen | last post by:
Hey everyone. I was wondering if someone could help me with a small problem. I have designed a user control and I would have inserted it on a aspz page (WebForm1). The User control is being used to...
0
by: Michael Brandt Lassen | last post by:
Hi gurus This problem is about calling Web services secured by Forms Authentication from Windows Forms user controls embedded in HTML. Using the object tag I’ve managed to include a Windows...
1
by: Neil | last post by:
Hi, I have an aspx page page with some existing controls code etc. This page has an update button which updates a SQL Db based on any user changes. I need to add a new section to this page and a...
1
by: Danny Ni | last post by:
Hi, I have a web form A that contains an user control B, which contains an user control C. Inside user control C, can I call methods in user control B and web form A? If yes, How? The mthods...
5
by: Simon Harris | last post by:
Hi All, I am trying to call a method in a web form, from an event fired in a user control. My user control displays a map, which has a link button to enlarge/shrink the map. When the user...
6
by: evandelagrammaticas | last post by:
Hi all. I have spent the better part of a day scouring the newsgroups and I am sure that I must have come across the solution a number of times - but I am still a real newbie at asp.net so please...
2
by: planetthoughtful | last post by:
Hi All, I have a Web User Control that I would like to use in several pages in my ASP.NET application. I'm wondering, however, if it's possible to call a function contained in the page from...
2
by: sumanthsclsdc | last post by:
Hello friends, I have a problem, I implemented a class which uses tkinter and displays the window as required, the class will create a window with listbox and inserts some items into it, I...
2
by: John Wright | last post by:
I have a central program I am starting to develop that will track processing deviations. This program is VB 2008 and needs to be called from VB 2005 programs and VB2008 programs (we have some VB 6...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.