Invoke Ajax OnClick from Provider Web Part to Consumer Web Part

I am attempting to manage an ajax connection by calling a button onclick method on a separate web part in order to force the partial postback on the consumer. 

Web part A (Provider) invokes the method on Web Part B (Consumer)

Web Part A

Type t = myButton.GetType();
            object[] p = new object[1];
            p[0] = EventArgs.Empty;
            MethodInfo m = t.GetMethod("OnClick", BindingFlags.NonPublic | BindingFlags.Instance);
            m.Invoke(myButton, p);

Web Part B

 public void btnHidden_Click(object sender, EventArgs e)
        {
            Label1.Text = "Hidden Button: " + DateTime.Now.ToString();
        }

When I use reflection, I get the correct information on the HiddenButton.  However, I cannot invoke the "OnClick" event.  The btnHidden_Click does not execute.  It works fine when I invoke from WebPart B to WebPart B, but not from a different webpart.

There doesn't appear to be too much information regarding this behavior.  Any suggestions?

Thanks.

Rob


Please Mark as Answer if it helps you in solving your problem
0
rtemple
12/29/2008 2:32:17 PM
asp.net.ajax-discussion 13973 articles. 1 followers. Follow

1 Replies
733 Views

Similar Articles

[PageSpeed] 22

Having you tried using a webpart connection http://msdn.microsoft.com/en-us/library/ms157515.aspx


Good Luck



0
Danny117
1/2/2009 6:52:51 PM
Reply:

Similar Artilces:

Using Web Parts and DataBinding across Web Parts with Ajax Update Panels.
Sorry in advance if this is better suited to the data presentation controls forum, but I'm not having a problem there, it's unique to web parts.  OK, I have two different Web User Controls (.ascx files) that have GridViews on them. They're all wrapped with Ajax update panels, so when a new row is added or an existing row is edited, etc. it's not a full postback. Great, looks awesome.Here's my issue, hopefully someone has run into this before. Let's call the Gridviews GV_A and GV_B. When I add a new record to GV_A, the database creates a new ID for the record behi...

Adding web parts in my AJAX web app causes it to crash
Hi All,  I have a working app that I decided to add web parts to. When I did it caused it to crash with the following error:System.Data.SqlClient.SqlException: Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'. When I pull out the web part code it works. Any ideas?   I have never seen that specific error before, but depending on how you are using the web part and AJAX....  Read the announcement at the top of this forum. It discusses specific issues with web parts and AJAX.Don't forget to click "Mark as Answer" on the post t...

AJAX + Web Parts = unable to move part in design mode.
When i introduce AJAX to my web parts I am unable to move my webparts around in design mode. Its like the surface to drag has disappeared. When i remove the ajax it works find.. i am able to grab the web part and move it.   Anyone run across this?  From Mike's blog : http://blogs.msdn.com/mharder/archive/2007/01/23/webparts-and-asp-net-ajax-1-0.aspx"Cross-browser drag and drop is enabled by using the WebParts controls in the AJAX Futures CTP.Modifying a WebParts page (drag and drop, minimize, restore, close, add, delete) without postback is implemented by wrapping the ...

Web Parts and .NET 3.5 AJAX
So I understand that external update panels should be fixed and working in .NET 3.5, but I've run into a few problems.  For example, if I wrap two web part zones in a single update panel (so I can drag and drop web parts between the two zones using a partial-page postback) in design mode, I can do so once, or maybe twice, and then I am no longer able to drop (but I can still drag).I've double checked to make sure that I wasn't referencing anything older (system.web.extensions is version 3.5.0.0). Has anyone else run into this problem/found a solution?Thanks in advance!&...

Web Parts and about server callbacks and Ajax.NET
Hi All I have one question. I have created Two Web Parts. I have created using ASP.net 2.0 Web Part Controls. One is Master Web Part and other is Details Web Part. When the selection in the master webpart changes, the detail must be updated accordingly. I wants to Implement "Client Callbacks Without Postbacks" on these two web parts. i.e. If i select any thing in the master web part it should display the details in the details web part with out post back. Can any one give me a solution for this. Thanks Phan ASP.NET WebParts has the Connections feature, but these are pro...

Web Parts and AJAX with .Net 2.0
Posted this in the controls section but perhaps it is better suited here.  Moderators feel free to delete the other post if necessary. Trying to get a handle on what the limitations are with using Web Parts with Update Panels/Update Progress, etc.  I am using .Net 2.0 and won't be going to 3.5 for a while.  I have found several sites (including the sticky at the top of this forum section) that said Web Parts are not compatible with AJAX via Update Panels but then found another site that had a control that inherited/replaced the Web Part control (Sample.Web....

Atlas and Web Parts / Web Part Framework
How is Microsoft differentiating Atlas from Web Parts and the Web Part Framework? Which is the right one to use when? Web Parts provide a rich infrastructure in ASP.NET to build composite, personalized application UI from individual components. Atlas provides a richer environment in the browser client for application UI to run more interactively. These are complementary technologies. In the future, web parts and Atlas will work together in a couple of important ways. First, the web parts infrastructure will take advantage of Atlas to provide even richer client-side intera...

Enumerating all the web parts on a page
I have a web part that needs to examine every other web part on a given page for info. I've tried two approaches, but neither seems to be the answer I'm looking for. First, I tried getting a reference to Parent (which returns the WebPartManager) and enumerating through it's Controls (or WebParts) collection. This almost works - it gives me every web part in the same WebPartZone as my web part. But it doesn't give me all the web parts in the other zones. Example:            WebPartManager wpm = (WebPartManager)this.Pa...

Consuming Web service from .net 3.5 web application using ajax
Hi , Before in .net 2005 ,I use to consume the  web service from client side via Ajax and java script. that's just adding web service inside the script manger services.But  it was not possible with .net 2008 version WEB APPLICATION   , Even it works well with .net 2008 web sites. Please help me to solve the issue. I have no idea what you mean. Please post the code that "does not work". NC...   I have the same problem.  I have a .NET 3.5 Web Application not Web Site.  I fully qualify the web service with the namespace i,e,  &n...

Ajax Web Part
Hi,   Working with Ajax Futures, I'm designing a Web Part including a UpdatePanel, and I expect to update its content without a postback. However this is not the case !   Referring to this post: http://forums.asp.net/p/1066700/1545256.aspx#1545256, it should work...     Any idea ? I've made a mistake and used the TimerControl (from Asp.Net Futures) instead of the simple Timer (from Ajax 1.0). So now it's ok......

Web Parts and AJAX
OK - so I understand the official line is that ASP.Net Ajax UpdatePanel does not work properly with Web Parts. However I am a little puzzled becuase I did a test and got something working fine: I built two CONNECTED web parts - one is a simple filename provider (a textbox and an Update button) the other web part displays a flash file based on the filename specified by the first web part. I put them both inside a web part zone, and then enclosed the WHOLE web part zone inside an Ajax Update Panel.  Now, when I enter a new filename inside the first web part and click its update butt...

Web Parts and AJAX
What new information is there on using AJAX and 2.0 ASP.NET Web Parts?  Specifically moving the web part from one zone to another with out a post back? Hi, Do you want to know if you can move webparts without postback or something else. Well if this is the case then yes you can use AJAX and WebParts to avoid post backs while moving the webparts here and there. Or if you wanted to know any updated information regarding both then I don't think there is any update specifically for webparts with ajax. Well in one of my projects I have used ajax with webparts including all the setting...

Speed of Web Parts with AJAX.NET 1.0
I have a query about the speed(client-side) of creating a web application with lots of web parts, and implementing ajax. I have read numerous articles saying that utilizing the AJAX.NET framework, specifically update panels and extended controls, makes the user experience "slow". The application we are going to build is to have a "page-flakes" style homepage, but that is not the central theme to the site. What would be anyones suggestions in terms of development??Thanks for all advice,Mick   I have not noticed any slowdown by using ajax in my webparts.  J...

Troubleshoot Web Service; Ajax AutoComplete events do not appear to not fire; Ajax web service appears to not work. .NET
Folks, I had the situation that Ajax AutoComplete events in the web service did not fire after I copied a project out of a folder, renamed it and moved it to a server. The fix was hard to find but easy to solve. I had some web service modules in an ASMX file that provided AutoComplete entries -- i.e., after the user keys in 2 or 3 characters, the list of possible entries with those leading characters is displayed for the user to select. To solve the problem, look at the web service's directive, not the code-behind or the ASMX designer.  Do a right-mouse-click...

Web resources about - Invoke Ajax OnClick from Provider Web Part to Consumer Web Part - asp.net.ajax-discussion

Providers - Wikipedia, the free encyclopedia
Jeppe Federspiel and Rasmus Stabell started as musicians playing drums. Years later, they joined forces to form Providers, an urban production ...

Provider - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Facebook Commerce Provider Payvment Launches Weekly Deals
Facebook commerce provider Payvment announced the rollout of a new weekly deals feature that allows sellers to feature three deals per week on ...

Rail provider Aurizon dealt another blow with train derailment in Queensland
Aurizon's miserable end to 2015 has continued, with a major train derailment in Queensland injuring three and spilling large quantities of sulphuric ...

Apple, Google among streaming providers NFL is expecting to bid on Thursday Night Football
... information about Apple , Google , and Apple TV continue reading at 9to5Mac . What do you think? Discuss "Apple, Google among streaming providers ...

STC becomes first service provider in MENA to deploy Cisco VPC technology
STC becomes first service provider in MENA to deploy Cisco VPC technology Arab News RIYADH: Saudi Telecom Company (STC), the largest telecommunication ...

Sling CEO: Comcast data caps so low they hurt competing video providers
(credit: Sling TV ) Sling TV CEO Roger Lynch accused Comcast of setting its data caps just low enough to prevent customers from replacing cable ...

Public option and provider reimbursement nudges
On Twitter, there is a long and productive discussion about provider pricing and the recent study on commercial payer rate variations. Part of ...

Salesforce: Bulls Love Purchase of App Provider SteelBrick
... has acquired startup SteelBrick , one of its application partners, for $360 million in stock. SteelBrick has billed itself as the largest provider ...

Cable providers still have no answer for Netflix as cord-cutting accelerates
While cable providers over the past few decades have grown fat off of exorbitant cable packages that overcharge and under-deliver, the rise of ...

Resources last updated: 1/5/2016 3:56:04 PM