ajaxtoolkit ModalPopupExtender issue

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
6/22/2011 9:21:25 PM
Gravatar
Total Posts 92
Нет, я не изменил. До старости глубокой...

ajaxtoolkit ModalPopupExtender issue

Please advice

i'm having an issue with AjaxControlToolkit ModalPopupExtender. Tried a simple code that should update labels after pressing "Save" in modal popup. Now, the modal popup is shown, but after pressing save, page is not updated (labels values are the same).

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>

<ajaxToolkit:ModalPopupExtender ID="mpe" runat="server"  TargetControlID="btn1" CancelControlID="btnCancel"
OkControlID="OKButton"
PopupControlID="ModalPanel"  />
      <div>
      Contact Information:
      <asp:Label ID="lblName" runat="server" Text="test" /><br />
      <asp:Label ID="lblEmail" runat="server" Text="email@test" /><br />
      <asp:Button ID="btn1" runat="server" Text="Edit" />
    </div>
    <asp:Panel ID="ModalPanel" runat="server" Width="500px" CssClass="mclass">
      Name: <asp:TextBox ID="tbName" runat="server" /><br />
      Email: <asp:TextBox ID="tbEmail" runat="server" /><br />
      <asp:Button ID="OKButton" runat="server" Text="Save" OnClick="SaveData"  CausesValidation="false" />
      <asp:Button ID="btnCancel" runat="server" Text="Cancel" />
    </asp:Panel>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using mojoPortal.Web;
using mojoPortal.Web.UI;
using mojoPortal.Business;
using mojoPortal.Business.WebHelpers;
using mojoPortal.Business.WebHelpers.UserRegisteredHandlers;
using mojoPortal.Web.Configuration;
using mojoPortal.Web.Controls;
using mojoPortal.Web.Editor;
using mojoPortal.Web.Framework;
using Resources;
namespace Test.Features.UI.Secure.MyProfile
{
    public partial class customProfileTabs1 : SiteModuleControl
    {
        protected void SaveData(object sender, EventArgs e)
        {
            lblName.Text = HttpUtility.HtmlEncode(tbName.Text);
            lblEmail.Text = HttpUtility.HtmlEncode(tbEmail.Text);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
          if (ScriptController != null)
                {
                    ScriptController.RegisterAsyncPostBackControl(OKButton);

                }

 

            if (!Page.IsPostBack)
            {
                tbName.Text = lblName.Text;
                tbEmail.Text = lblEmail.Text;
                           }

        }
    }
}

6/23/2011 1:39:37 PM
Gravatar
Total Posts 18439

Re: ajaxtoolkit ModalPopupExtender issue

Hi Ghalib,

Sorry I don't have any advice on this one as I've never used the ModalPopupExtender, probably google is your best bet to find an answer on this one, only thing I might try is wrapping it in an UpdatePanel.

Myself when I want a modal dialog I use a real .aspx page for the dialog and I open it with colorbox to make it modal. If you make a link to a page with the class="cblink" it will open it in a colorbox modal.

Maybe someone else has used this and has some ideas but I have no experience with that particular control.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.