PC Review


Reply
Thread Tools Rate Thread

Calling method in different page?

 
 
perplexed
Guest
Posts: n/a
 
      29th Jan 2007
I have an ascx file (call it usercontrol) that loads into an aspx file
(parent). Usercontrol contains a hyperlink that when clicked, calls a
method on parent that will than load text into parent.label1. From
Usercontrol, I've tried using a linkbutton and its
OnClick="assemblyname.ParentPage.SomeMethod("my test text")" but that
doesn't work. Any ideas how this is done?

Thanks.

 
Reply With Quote
 
 
 
 
Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
Guest
Posts: n/a
 
      29th Jan 2007
The best way is to raise an event to the page.
I've listed more details on the subject here:
http://SteveOrr.net/faq/PassDataFromUserControl.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net


"perplexed" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I have an ascx file (call it usercontrol) that loads into an aspx file
> (parent). Usercontrol contains a hyperlink that when clicked, calls a
> method on parent that will than load text into parent.label1. From
> Usercontrol, I've tried using a linkbutton and its
> OnClick="assemblyname.ParentPage.SomeMethod("my test text")" but that
> doesn't work. Any ideas how this is done?
>
> Thanks.
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a method in different aspx.vb code page =?Utf-8?B?am9obmY0MDE=?= Microsoft Dot NET Framework 3 31st Oct 2004 08:31 PM
Calling a method in different aspx.vb code page =?Utf-8?B?am9obmY0MDE=?= Microsoft VB .NET 6 31st Oct 2004 05:34 PM
Calling a method in different aspx.vb code page =?Utf-8?B?am9obmY0MDE=?= Microsoft VB .NET 0 30th Oct 2004 09:05 PM
calling a soap method from an asp page Alexander Jagl Microsoft ASP .NET 0 18th Aug 2004 01:54 AM
Deduce calling Page or UserControl in library method JezB Microsoft ASP .NET 1 26th May 2004 02:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:20 PM.