Home Search Member List Faq Register Login  
UltimateAjax
ajax on a content page

Thread Starter: lweekly   Started: 01-28-2008 3:15 PM   Replies: 3
 Karamasoft Support Forums » General Discussions » UltimateAjax » ajax on a content page
 Printable Version    « Previous Thread   Next Thread »
  28 Jan 2008, 3:15 PM
lweekly is not online. Last active: 1/13/2009 1:42:24 PM lweekly

Top 10 Posts
Joined on 12-14-2007
Kansas City, KS
Posts 37
ajax on a content page
I want to use Ajax on a content page (to a Master page). I have it working fine on another page that doesn't use a Master.

Since there is no <head> section on a content page, I put it in the <head> of the master page. I also tried putting it in the <asp:Content> section on the content page.

But, the UltiamteAjax1.Callback never fires.

In debug, I see the Attributes getting added to the drop down lists, but when I change a value in them, nothing happens.

In my master page I have:

<head id="Head1" runat="server">

<title>KSB News Page</title>

<link href="~/App_Themes/DarkGradient/stylesheet.css" type="text/css" rel="stylesheet" />

<script language="javascript">

function UpdateTable(arg) {

DoUltimateCallback('UltimateAjax1', arg);

}

</script>

</head>


On my content page I have:

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">

<%-- <script language="javascript">

function UpdateTable(arg) {

DoUltimateCallback('UltimateAjax1', arg);

}

</script>--%>

&nbsp;&nbsp;

<asp:Image ID="Image2" runat="server" />

<table>

<tr>

<td>

<cc1:UltimateAjax id="UltimateAjax1" runat="server" Width="425px" Height="70px">

<asp:Table ID="Table2" width=400 runat="server"></asp:Table>

<table style="width: 492px">

<tr>

<td style="width: 75px">

Select Issue:</td>

<td style="width: 100px">

<asp:DropDownList ID="ddYear" runat="server" >

<asp:ListItem Value="Year"></asp:ListItem>

<asp:ListItem Value="2008">2008</asp:ListItem>

<asp:ListItem Value="2007">2007</asp:ListItem>

<asp:ListItem Value="2006">2006</asp:ListItem>

<asp:ListItem Value="2005">2005</asp:ListItem>

<asp:ListItem Value="2004">2004</asp:ListItem>

<asp:ListItem Value="2003">2003</asp:ListItem>

<asp:ListItem Value="2002">2002</asp:ListItem>

<asp:ListItem Value="2001">2001</asp:ListItem>

</asp:DropDownList></td>

<td style="width: 100px">

<asp:DropDownList ID="ddMonth" runat="server" >

<asp:ListItem Value="Month"></asp:ListItem>

</asp:DropDownList></td>

<td style="width: 100px">

<asp:HyperLink ID="viewLink" target="_blank" runat="server" Width="132px">&nbsp;&nbsp;&nbsp;View Newsletter</asp:HyperLink></td>

</tr>

</table>

</cc1:UltimateAjax>

</td>

</tr>

</table>

</asp:Content>

And in the code behind I have:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Dim i As Integer = 0

Dim j As Integer = 0

Dim lon As String = Page.ClientQueryString

Image2.Visible = False

Image3.Visible = False

ddYear.Visible = False

ddMonth.Visible = False

viewLink.Visible = False

 

If Not Page.IsPostBack Then

ddYear.Attributes.Add("onchange", "UpdateTable('Year');")

ddMonth.Attributes.Add("onchange", "UpdateTable('Month');")

End If

............
End Sub


Private Sub UltimateAjax1_Callback(ByVal sender As System.Object, ByVal e As Karamasoft.WebControls.UltimateAjax.CallbackEventArgs) Handles UltimateAjax1.Callback

Select Case (e.Argument)      'This sub never fires

Case "Year"

LoadMonth()                        'So these don't fire either

Case "Month"

SetURL()

End Select

End Sub


I suppose it's something stupid on my part, but I can't see it.  Thanks for any help.


-Lon


  
  28 Jan 2008, 3:42 PM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: ajax on a content page
You may try updating DoUltimateCallback('UltimateAjax1', arg); to use the client-side id of the UltimateAjax control. Do a View Source on your page to see the client id such as ctl00_UltimateAjax1. Then call DoUltimateCallback('ctl00_UltimateAjax1', arg);
  
  28 Jan 2008, 4:16 PM
lweekly is not online. Last active: 1/13/2009 1:42:24 PM lweekly

Top 10 Posts
Joined on 12-14-2007
Kansas City, KS
Posts 37
Fixed!
As usual, you have all the answers!  That took care of it.

I replaced

DoUltimateCallback('UltimateAjax1', arg);

with

DoUltimateCallback('ctl00_ContentPlaceHolder2_UltimateAjax1', arg);


in the <script> section.


Thanks a billion,

Lon


  
  07 Sep 2008, 11:45 AM
vasilaky is not online. Last active: 5/1/2009 10:59:27 AM vasilaky

Top 10 Posts
Joined on 02-12-2008
Posts 41
Re: ajax on a content page
That was my problem as well.
Thanks

  
 Page 1 of 1 (4 items)
Karamasoft Support Forums » General Discussions » UltimateAjax » ajax on a content page

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2018 Karamasoft LLC. All rights reserved.