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

HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIProblem using AJax & MultiView controlProblem using AJax & MultiView control
Previous
 
Next
New Post
1/23/2009 3:30 AM
 

I'm trying to use AJAX and a MultiView control together.  I've created a small example, listed below.   If I remove the AJAX in my Page_Load, the code works.  But if I enable the AJAX the views will no longer retain their field views when I change between the views.


--------------------

ascx.vb code:


Imports DotNetNuke

Namespace XYZ

    Partial Class AjaxTest
        Inherits Entities.Modules.PortalModuleBase


        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Try

                '--- remove this section to see it work ---
                If DotNetNuke.Framework.AJAX.IsInstalled Then
                    DotNetNuke.Framework.AJAX.RegisterScriptManager()
                    DotNetNuke.Framework.AJAX.WrapUpdatePanelControl(PanelMain, True)
                    DotNetNuke.Framework.AJAX.RegisterPostBackControl(txtAmounToPay)
                End If

                If Not Page.IsPostBack Then
                    MultiView1.SetActiveView(view1)           
                    txtAmounToPay.Text = "100.00"
                    ComputeFee()
                End If

            Catch exc As Exception
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub

        Private Sub ComputeFee()
            Dim amount As Decimal = 0
            Dim tax As Decimal = 0
            Dim total As Decimal = 0

            Try
                amount = CType(txtAmounToPay.Text, Decimal)
                tax = amount * 0.07
                total = amount + tax
            Catch ex As Exception
            End Try

            lblTax.Text = tax
            lblTotal.Text = total
        End Sub

        Protected Sub txtAmounToPay_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles txtAmounToPay.TextChanged
            ComputeFee()
        End Sub

        Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
            MultiView1.SetActiveView(view1)
        End Sub

        Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click
            MultiView1.SetActiveView(view2)
        End Sub

    End Class

End Namespace


----------------


.asc.vb

<%@ Control Inherits="XYZ.AjaxTest" Language="vb" AutoEventWireup="false"
    Explicit="True" CodeBehind="AjaxTest.ascx.vb" %>
<asp:Panel ID="PanelMain" runat="server">
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="view1" runat="server">
            <asp:Panel ID="Panel3" runat="server" BackColor="#CCFFFF">
                View #1 ------------<br />
                List of products, etc, etc.....
            </asp:Panel>
        </asp:View>
        <asp:View ID="view2" runat="server">
            <asp:Panel ID="Panel1" runat="server" BackColor="Lime">
                View #2 ------------
                <table width="100%">
                    <tr>
                        <td>
                            Sub Total:
                        </td>
                        <td>
                            <asp:TextBox ID="txtAmounToPay" runat="server" AutoPostBack="True">0.00</asp:TextBox>
                            &nbsp;&nbsp;&nbsp;
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Tax:
                        </td>
                        <td>
                            <asp:Label ID="lblTax" runat="server" Text="0.00"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Total:
                        </td>
                        <td>
                            <asp:Label ID="lblTotal" runat="server" Text="0.00"></asp:Label>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <asp:Panel ID="Panel2" runat="server">
            </asp:Panel>
        </asp:View>
    </asp:MultiView>
    <asp:Button ID="Button2" runat="server" Text="View 1" />
    &nbsp;
    <asp:Button ID="Button3" runat="server" Text="View 2" />
</asp:Panel>
 

---------------------

VS2008 / DNN v 4.9.1

 
New Post
2/4/2009 8:40 AM
 

Sorry for the late response.  It sounds like your having a problem with the updatepanel and multi-view control, both Microsoft controls.  I would recommend looking into their forums for the answer as I don't think the problem is isolated to DNN.  Here is one thread.


 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Provider and Extension ForumsProvider and Extension ForumsClientAPIClientAPIProblem using AJax & MultiView controlProblem using AJax & MultiView control


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