WebFlyPostBackMethod() attribute is not working in SharePoint WebPart ?

1 reply. Last post: April 5, 2010 4:10 AM by Glenn Layaar
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
Gaurav DesaiMember

Please find the attached sample havin an aspx file and its code behind having two drop down lists with flypostback manager implemenation. It works just absoutely fine and when i implemented same in my SharePoint web part where on clic of a button i want to get some date asynchronously and refresh the grid with latest data asyncrhonously withough full page post back, but i am getting javascript error saying object or method is undefined. It seems even after adding attribute to the method it is not accessible in javascript..

Some of the code extract i added for WebFlyPostBackManager

1. In CreateChildControls() method.

webFlyPostBackManager = new WebFlyPostBackManager();

webFlyPostBackManager.BlockPageUIOnBusy = true;

webFlyPostBackManager.BlockPageUIOnBusy = true;

webFlyPostBackManager.BlockPageUIOnBusy = true;

new WebFlyPostBackManager();

webFlyPostBackManager.BlockPageUIOnBusy = true;

true;

webFlyPostBackManager.ID = "webFlyPostBackManager";

"webFlyPostBackManager";

webFlyPostBackManager.IsDynamicCreated = true;

webFlyPostBackManager.ServiceUrl = "~/Default.aspx";

webFlyPostBackManager.EnableUIMode =

webFlyPostBackManager.EnableUIMode =

webFlyPostBackManager.EnableUIMode =

webFlyPostBackManager.EnableUIMode =

Controls.Add( webFlyPostBackManager );

 

interSoftWebUIGrid.FlyPostBackSettings.PostHiddenFields = true;

interSoftWebUIGrid.FlyPostBackSettings.PostInputControls = true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

interSoftWebUIGrid.FlyPostBackSettings.PostInputControls = true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

interSoftWebUIGrid.FlyPostBackSettings.PostInputControls = true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

true;

interSoftWebUIGrid.FlyPostBackSettings.PostInputControls = true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

true;

interSoftWebUIGrid.FlyPostBackSettings.PostViewState = true;

true;

2. In WebPart code file

[WebFlyPostBackMethod()] public void MyMethodName()

{

    interSoftWebUIGrid.ClearCachedDataSource();

    interSoftWebUIGrid.RebindDataSource();

    webFlyPostBackManager.ClientAction.UpdateViewState();

    webFlyPostBackManager.ClientAction.RenderControl( interSoftWebUIGrid);

}

 

3. In JavaScript

function ClientSideShowNextTimePeriodData(objWebFlyPostBackManager)

{

      var fpb = ISGetObject(objWebFlyPostBackManager);

      fpb.ShowNextTimePeriodData();

     // Above line gives an error saying Error: Object doesn't support this property or method

}

 

Any idea why i am not able to get this method on client side even after adding the required attribute to it ?

Can you please send us a small SharePoint web part example for doing this ?

Thank you.

All times are GMT -5. The time now is 9:42 PM.
Previous Next