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

Nested Repeater Ajaxification

4 Answers 78 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Hari Prasad
Top achievements
Rank 1
Hari Prasad asked on 29 Apr 2010, 06:51 PM

I have aspx page(which contains master page), inside that user control is there(.ascx), inside this user control one more user control is there. Inside this user control, I have parent repeater in that i have image button and child repeater, inside the child repeater i have link button, i did ajaxification for image button. below is the detail code

 

<

 

asp:Repeater ID="ParentRepeater" runat="server">

 

 

 

 

 

<ItemTemplate>

 

 

 

<asp:ImageButton ID="ExpandCollapseImageButton"

 

 

runat="server"

 

 

CssClass="dimensionExpCol"

 

 

ImageUrl='<%#Eval("ImageUrl")%>'

 

 

OnClientClick='<%#Eval("Args", "OnClientClick(\"{0}\");return false;")%>'

 

 

 

 

 

 

/>

 

 

 

<asp:Repeater ID="ChildRepeater" runat="server" DataSource='<%#Eval("LinkValues")%>'>

 

 

 

 

 

<ItemTemplate>

 

 

 

 

 

<div class="dimensionValueWrapper">

 

 

 

 

 

<asp:LinkButton ID="ChildRepeaterLinkButton"

 

 

runat="server"

 

 

CssClass="dimensionValueName"

 

 

 

 

 

Text='<%#Eval("DisplayName")%>'

 

 

CommandName='<%#Eval("CommandName")%>'

 

 

 

 

 

CommandArgument='<%#Eval("CommandArgument")%>'

 

 

 

 

 

OnCommand="OnCommand"></asp:LinkButton>

 

 

</div>

 

 

 

</ItemTemplate>

 

 

 

 

 

</asp:Repeater>

In Code Behind:

 

protected

 

override void OnLoad(EventArgs e)

 

{

 

base.OnLoad(e);

 

 

RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(Page);

 

 

RadAjaxLoadingPanel loadingPanel =

 

(

RadAjaxLoadingPanel)Page.Master.FindControl("LoadingPanel");

 

ajaxManager.AjaxRequest += OnAjaxManagerAjaxRequest;

 

ajaxManager.AjaxSettings.AddAjaxSetting(

ajaxManager, ParentRepeater, loadingPanel);

 

RegisterJavaScript();

 

}

 

private

 

void RegisterJavaScript()

 

{

 

string script =

 

 

@"

 

<script type=""text/javascript"">

 

function OnClientClick(args)

{

var ajaxManager = $find("""

 

+ RadAjaxManager.GetCurrent(Page).ClientID + @""");

 

ajaxManager.ajaxRequest(args);

}

</script>"

 

;

 

 

ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "Test", script, false);

 

}

 

protected

 

void OnAjaxManagerAjaxRequest(object sender, AjaxRequestEventArgs e)

 

{
//code has been implemented
}

 

protected

 

void OnCommand(object sender, CommandEventArgs eventArgs)

 

{
}

If i click on image button i.e working fine,JavaScript is firing(OnClientClick();) and Ajaxification is also working fine, but inside the child repeater if i click on link buttons total Repeater(Parent) is disappearing. Link button OnCommand event is firing. But I am not able to see the total Repeater. Actually if i click on link button, i am showing some results inside the Grid. I am getting those results as well. But Repeater is disappearing.

Can you tell me the what will be the Reason and what would be the solution for that.

Thanks in Advance

Hari.

4 Answers, 1 is accepted

Sort by
0
Hari Prasad
Top achievements
Rank 1
answered on 29 Apr 2010, 07:59 PM
Without Ajaxification it's working fine for me. I think because of Ajaxification only the Repeater is disappearing.

Thanks
Hari.
0
Iana Tsolova
Telerik team
answered on 04 May 2010, 02:11 PM
Hi Hari,

Can you try adding an ajax setting as below where the parent repeater updates itself and see if it makes any difference:

ajaxManager.AjaxSettings.AddAjaxSetting(ParentRepeater, ParentRepeater, loadingPanel);


Greetings,
Iana
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
Hari Prasad
Top achievements
Rank 1
answered on 18 May 2010, 10:52 AM
Sorry for late reply, my application was in some modifications, that's the reason why i was not able to test it.
I have tested by keeping parent repeater. But still it's not working. Really i am not understanding what is happening here. Please suggest some more solutions.

Thanks in advance,
Hari.
0
Iana Tsolova
Telerik team
answered on 18 May 2010, 02:33 PM
Hi Hari,

Would it be convenient for you to send me a runnable version of your code, with sample data, etc.? I will debug it locally in order to replicate the issue and turn back to you with a resolution.

Sincerely yours,
Iana
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
Hari Prasad
Top achievements
Rank 1
Answers by
Hari Prasad
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or