Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0AJAX Beta Release, DNN and CatalookAJAX Beta Release, DNN and Catalook
Previous
 
Next
New Post
10/28/2006 11:29 AM
 

I'm trying to add AJAX to the following page.

http://www.skorbordz.com/Motocross/tabid/459/CategoryID/67/List/1/SortField/1/Level/a/ProductID/5/Default.aspx

The module is Catalook, which is very nice, but if you use advanced product options every product option change does a post back so I thought I could improve this with AJAX.

So, I watched a hello world AJAX Atlas tutorial, downloaded the new AJAX beta and developed my own little ajax page at www.freesis.net/test.aspx.  It works fine.

I then went to Catalook and I opened the ascx file productpage.ascx. I see that all it contains is a place holder so I add a script manager, updatepanel, and contentpanel. Then moved the panel the script was loading to into that.

<script language="javascript">

function Lookup(spage) {window.open(spage,'Lookup', 'scollbars=yes,menubar=no,height=500,width=565');}

</script>

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">

</asp:ScriptManager>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

<ContentTemplate>

<asp:placeholder id="SkinHolder" runat="server"></asp:placeholder>

</ContentTemplate>

</asp:UpdatePanel>

<asp:Label ID="lblAjax" width="400" Height="400" runat="server" Text="Label" Visible=false></asp:Label>

 

There's also a label I used to output some text when adding ajax triggers to the update panel so I could see that work.

Then I opened the code behind and dim the update panel and label as protected with evens so I could compile the dll. I also added the following MakeAJAX function that I call after the product options are loaded on page load. I had the label visible so I could see the triggers being added but it is now invisible.

here's makeajax

Private Sub MakeAjax()

Dim i As Integer

lblAjax.Text = lblAjax.Text & "loading Ajax..."

For i = 0 To lstProductOptions.Items.Count - 1

' Obtain references to row's controls

Dim ddlOptions As DropDownList = CType(lstProductOptions.Items(i).FindControl("ddlOptions"), DropDownList)

'If ddlOptions.Visible = True Then

If ddlOptions.Items.Count > 0 Then

Dim trigger As New Microsoft.Web.UI.AsyncPostBackTrigger()

trigger.ControlID = ddlOptions.UniqueID

trigger.EventName = "SelectedIndexChanged"

UpdatePanel1.Triggers.Add(trigger)

lblAjax.Text = lblAjax.Text & ddlOptions.UniqueID & "..."

End If

'If ddlColors.Visible = True Then 'UserDefinedColors.Count > 0 Then

Next

End Sub

 

Problem is it doesn't do anything. I veiw html and compared label output and everything looks right but everything still does a postback

 
New Post
10/28/2006 11:36 AM
 
Test.aspx uses the same web.config as the other page so I expect I made my web.config changes correctly.
 
New Post
10/28/2006 1:58 PM
 

might be making some progress..

the trigger is added with this id value

dnn:ctr840:ProductPage:lstProductOptions:_ctl0:ddlOptions

the select statement looks like this

<select name="dnn:ctr840:ProductPage:lstProductOptions:_ctl0:ddlOptions" onchange=" setTimeout('__doPostBack(\'dnn$ctr840$ProductPage$lstProductOptions$_ctl0$ddlOptions\',\'\')', 0)" language="javascript" id="dnn_ctr840_ProductPage_lstProductOptions__ctl0_ddlOptions" class="CATNormalTextBox">

now the name is correct but the id is not correct and javascript usually reads the id and not the name.

I'll try using clientID instead of UniqueID

 
New Post
10/28/2006 2:33 PM
 

that didn't work, created the following error :(

A control with ID 'dnn_ctr840_ProductPage_lstProductOptions__ctl0_ddlOptions' could not be found for the trigger in UpdatePanel 'UpdatePanel1'.

 
New Post
10/28/2006 5:24 PM
 

Ok, figured out my problem thanks to this post.

http://www.dotnetnuke.com/Community/ForumsDotNetNuke/tabid/795/forumid/111/threadid/79706/threadpage/1/scope/posts/Default.aspx

 

I had to change some xml setting from legacy to transitional.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0AJAX Beta Release, DNN and CatalookAJAX Beta Release, DNN and Catalook


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out