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

AjaxManager not working

1 Answer 83 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
TIM
Top achievements
Rank 1
TIM asked on 25 Apr 2012, 06:04 PM
Hello, I've seemed to always have issues with ajaxing my pages using the AjaxManager.


In 2 of my pages, they are pretty straight forward. In one page I did get it to work, but now it appears it doesn't want to work at all. It's doing normal postbacks(reloading the page) which is screwing with the results.


On Page 1:
I have a grid that I am using a item template on to add a textbox:
<telerik:GridTemplateColumn FilterControlAltText="Filter Size_Small column"
    HeaderText="S" UniqueName="Size_Small" DataField="Size_Small">
    <ItemTemplate>
        <telerik:RadTextBox ID="txt_Small" runat="server" Width="25" MaxLength="4" Text="0" ></telerik:RadTextBox>
    </ItemTemplate>
</telerik:GridTemplateColumn>

I also have a standard label on the page named lbl_Brand.

For TESTING purposes, I put up a button (button1) and made the following code in it:

For Each item As GridDataItem In grid_Colors.MasterTableView.Items
    Dim txtbox As RadTextBox = item("Size_Small").FindControl("txt_Small")
    lbl_Brand.Text = item("ColorName").Text & " : Small: " & txtbox.Text
Next

As per this, it should display the ColorName(It works even though i didn't include code), and then it ALWAYS returns Small: 0. It's returning the DEFAULT value of that textbox.

So, I am trying to ajax it so it doesn't reload the page on me, here is the code:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                                    <ajaxsettings>
                                        <telerik:AjaxSetting AjaxControlID="Button1">
                                            <updatedcontrols>
                                                <telerik:AjaxUpdatedControl ControlID="lbl_Brand"
                                                    UpdatePanelRenderMode="Inline" />
                                            </updatedcontrols>
                                        </telerik:AjaxSetting>
                                    </ajaxsettings>
                                </telerik:RadAjaxManager>

As you can see, I have Button1 setup to update lbl_Brand which is what should display the value. However, this is causing the page to reload.


Is there a certain process to adding the ajaxmanager and using it? Like, does it's location in the html matter? Does it need to be in a certain framework? Etc.

1 Answer, 1 is accepted

Sort by
0
TIM
Top achievements
Rank 1
answered on 25 Apr 2012, 11:24 PM
I figured out my ajax issue, i had the scriptmanager after all the components. I was unaware i needed to do it before.
Tags
Ajax
Asked by
TIM
Top achievements
Rank 1
Answers by
TIM
Top achievements
Rank 1
Share this question
or