What is "My quotes"?
Access UserControl
Hello Guest
  
  • Login
• Register…
• Start blog
  • Who, Where, When
• What can I do?
• What to Read?
  • Polls
• Avatars
• Interests
  • Cities and Countries
• Random blog
• Users search
  • Search
• Games
• Tests
• QAIX
  • Сообщества
• Talxy Chat
• Horoscope
• Online
 
Зарегистрируйся!

QAIX > .Net Development > Access UserControl 10 May 2008 01:53:24

  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Moderators:

Access UserControl

Gabriel 10 May 2008 01:53:24
 Hello,

I created a UserControl (MyUserControl.ascx­). At design time I added this
control the a page (MyPage.aspx). No problem when I execute the page I see
it.

I'd like access to some method and properties from MyPage.aspx.cd (first
form Page_load but may be others).

Could you tell me how to access the method of my UserControl ?

Regards,

===================­================
This list is hosted by DevelopMentor® http://www.develop.­com

View archives and manage your subscription(s) at http://discuss.deve­lop.com

Add comment
Efran Cobisi 10 May 2008 01:53:24 permanent link ]
 
Could you tell me how to access the method of my UserControl ?

To access your user control methods from within its containing page
code, you should first make sure that the control itself has an ID
properly set; after that, ensure the methods or properties you'd like to
reach are public ones.
Given that, public members of your control should now be accessible
using its mapped istance variable, named after the ID you set previously.

[Page markup]
<custom:MyControl id="foo" runat="server" />

[User control code]
public void Bar() { // Method implementation }

[Page code]
foo.Bar();

HTH
--
Efran Cobisi
http://www.cobisi.c­om

===================­================
This list is hosted by DevelopMentor® http://www.develop.­com

View archives and manage your subscription(s) at http://discuss.deve­lop.com

Add comment
 

Add new comment

As:
Login:  Password:  
 
 
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или УК РФ.


QAIX > .Net Development > Access UserControl 10 May 2008 01:53:24

see also:
Re: [Fwd: Apache::Reload Module]
What is the Prior Version of…
Changing Password in user table out of…
пройди тесты:
see also:
Motherboards
Annual Ukrainian Outsourcing Forum…
12 Step Recovery Program For Web…

  Copyright © 2001—2008 QAIX
Idea: Miсhael Monashev
Помощь и задать вопросы можно в сообществе support.qaix.com.
Сообщения об ошибках оставляем в сообществе bugs.qaix.com.
Предложения и комментарии пишем в сообществе suggest.qaix.com.
Информация для родителей.
Write us at:
If you would like to report an abuse of our service, such as a spam message, please .