rfurdzik:
The problem is that it is coming to the page on master and on the page which is using that master (help.aspx). How can I avoid the collision?
Either change the ID value of the extender on your master page or on your content page.
You cannot have 2 server controls with the same ID.
Thanks but HOW do I do it?? It is in ASCX control, both master and page is using the same ASCX control. if I change it this ASCX control, it will change in both places... I rather not create a seperate ASCX control with the same code... There must be better solution.
Don't use it in both places.
Either only access it via the user control or access it from the master page within your page or ascx control.
Tim
The requirement is to have it on master page. In addition the page contains the same control as well.
Is not there a way to change BahaviorID "on fly"?
I guess the second option (prefer 1) would be to grammatically removing it from master...
OK, did did it:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using AjaxControlToolkit;using AspNet.StarterKits.Classifieds.BusinessLogicLayer;
publicpartialclassHelp : System.Web.UI.Page
{
protectedvoid Page_Load(object sender,EventArgs e){
Controls_EmailPanel emailMasterPanel = (Controls_EmailPanel)Master.FindControl("Email");if ((emailMasterPanel !=null)){
ModalPopupExtender emailDialog = (ModalPopupExtender)emailMasterPanel.FindControl("ModalPopupExtender2");
if (emailDialog !=null)emailDialog.BehaviorID = emailDialog.ID +"2";}
}
}
No comments:
Post a Comment