This is a migrated thread and some comments may be shown as answers.

Updating usercontrol with radpopup close (radAjaxManagerProxy)

3 Answers 116 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
A K
Top achievements
Rank 1
A K asked on 27 Apr 2010, 07:59 PM

On a webpage I am adding RadpanelItems with user controls dynamically. One user control is added multiple times. On a user control there is a hyperlink which opens a radpop up window to select a financial institution user selects a financial institution. After clicking submit button on this pop up should set text boxes and labels on a user control. I know how to do this and I implemented according to example.

I have radAjaxproxymanager on a user control. The problem is since I have multiple user controls on a page inside panel bar and one of them is going start ajax request. But submit button click on pop up window by default sending postback to the parent page ( on which user controls reside) I am getting confused How to update the only one user control on which hyper link was clicked. Following is my code.

This is the code on user control ascx page.

  <telerik:RadAjaxManagerProxy runat="server" ID="RadAjaxManagerProxy1">

      <AjaxSettings>

            <telerik:AjaxSetting AjaxControlID="hyperlinkChangeFI">

                   <UpdatedControls>

                        <telerik:AjaxUpdatedControl ControlID="lblFINameText" /> 

                        <telerik:AjaxUpdatedControl ControlID="txtWebsite" />                    

                  <telerik:AjaxUpdatedControl ControlID="txtPhoneNumber" />

                         <telerik:AjaxUpdatedControl ControlID="hdnFIId" />

             </UpdatedControls>  

            </telerik:AjaxSetting>

      </AjaxSettings>

</telerik:RadAjaxManagerProxy>

 

  <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  

    <script type="text/javascript">

 

      function refreshPage(arg) {

            var Ajax = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>")

            if (Ajax) {

                  Ajax.ajaxRequest("Rebind"); // Invoking ajaxRequest

            }

      }

            

  </script>

</telerik:RadCodeBlock>

This is the event on the usercontrol ( for each user control this event is fired after clicking submit button on a pop up how to get handle of the usercontrol on which hyperlink was clicked?)

 

Private Sub Manager_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs)

 

            If e.Argument = "Rebind" Then

 

                  If Session("SelectedInstitution") IsNot Nothing Then

                        Dim SelectedInstitution As Institution = DirectCast(Session("SelectedInstitution"), Institution)

 

                        With SelectedInstitution

                              lblFINameText.Text = .Name

                              txtWebsite.Text = .WebsiteUrl

                              txtPhoneNumber.Text = .CustomerServicePhone

                              hdnFIId.Value = .Id.ToString

                              Session("SelectedInstitution") = Nothing

                        End With

 

                  End If

            End If

 

      End Sub

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Maria Ilieva
Telerik team
answered on 30 Apr 2010, 09:42 AM
Hello,

Could you please try to use the ajaxRequestWithTarget(eventTarget, eventArgument) function instead of ajaxRequest and see if it works as expected.

For more information, please refer to these articles:
http://www.telerik.com/help/aspnet-ajax/ajxclientsideapi.html
http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/clientsideapi/defaultcs.aspx

Sincerely yours,
Maria Ilieva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
A K
Top achievements
Rank 1
answered on 04 May 2010, 12:28 PM

Can you please help me which Control I use as Event target in my case?

I have multiple user controls on a parent page ( created Dynamically) each user control have a hyperlink to open a rad window. User selects one financial institution on the radpop up window and then he closes the radwindow. After radwindow is closed I want to update the only user control on the parent page with selected financial institution.

 

Thanks

0
Maria Ilieva
Telerik team
answered on 10 May 2010, 09:01 AM
Hello,

You should add the UniqueID of the control which is the update initiator. In your case you could add the corresponding User control to be updated on the relevant RadWindow close event.


All the best,
Maria Ilieva
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Ajax
Asked by
A K
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
A K
Top achievements
Rank 1
Share this question
or