Web Deployment error for WebUserControl event [modified]
-
Hi All, I am deploying my website by using add webdeployment project. But in my website i have used the WebUserControls in my website. The WebUserControls events are handled in form[which contains WebUserControl] through Delegates & Event Handlers. These events of WebUserControl have been initialized at form Default.aspx Page Init event. When i build the Project it gives no errors, the site runs perfectly... But when build the Deployment project i got a compilation errors of WebUserControl events where i initilized at form Default.aspx page init event. Its giving error message like 'MyUserControlUC' could not found are u missing add reference. For sample: ========== MyUserControlUC.ascx
//delegate
public delegate void DropDownSelectedIndexChanged(object sender, EventsArgs e);
//event
public event DropDownSelectedIndexChanged IndexChanged;
//call the event
protected void ddl_items_SelectedIndex_Changed(object sender, EventsArgs e)
{
if(IndexChanged != null)
IndexChanged(sender,e);
}Default.aspx
<%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %>
Default.aspx.cs
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
InitializeComponent();
}
private void InitializeComponent()
{
this.Load += new EventHandler(this.Page_Load);
SampleUserControl1.IndexChanged += new ASP.MyUserControlUC.SelectedIndexChanged(ddl_items_SelectedIndexChanged);//Here i am getting error while building deployment project.
}private void ddl_items_SelectionIndexChanged(Object sender, EventArgs e)
{
//Code here to handle ...
}Thanks & Regards
modified on Tuesday, February 16, 2010 8:06 AM
-
Hi All, I am deploying my website by using add webdeployment project. But in my website i have used the WebUserControls in my website. The WebUserControls events are handled in form[which contains WebUserControl] through Delegates & Event Handlers. These events of WebUserControl have been initialized at form Default.aspx Page Init event. When i build the Project it gives no errors, the site runs perfectly... But when build the Deployment project i got a compilation errors of WebUserControl events where i initilized at form Default.aspx page init event. Its giving error message like 'MyUserControlUC' could not found are u missing add reference. For sample: ========== MyUserControlUC.ascx
//delegate
public delegate void DropDownSelectedIndexChanged(object sender, EventsArgs e);
//event
public event DropDownSelectedIndexChanged IndexChanged;
//call the event
protected void ddl_items_SelectedIndex_Changed(object sender, EventsArgs e)
{
if(IndexChanged != null)
IndexChanged(sender,e);
}Default.aspx
<%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %>
Default.aspx.cs
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
InitializeComponent();
}
private void InitializeComponent()
{
this.Load += new EventHandler(this.Page_Load);
SampleUserControl1.IndexChanged += new ASP.MyUserControlUC.SelectedIndexChanged(ddl_items_SelectedIndexChanged);//Here i am getting error while building deployment project.
}private void ddl_items_SelectionIndexChanged(Object sender, EventArgs e)
{
//Code here to handle ...
}Thanks & Regards
modified on Tuesday, February 16, 2010 8:06 AM
If you are having the UCs in different project from the main web site, then check if the Build order of the solution is set correctly and check if you have enabled compiling the primary assembly and all it dependencies. HTH!
-
If you are having the UCs in different project from the main web site, then check if the Build order of the solution is set correctly and check if you have enabled compiling the primary assembly and all it dependencies. HTH!
Hi Dinesh, Thanks for ur reply. But the WebUserControl are in sample project.i.e, in main website it self Regards, kv sekhar
-
Hi Dinesh, Thanks for ur reply. But the WebUserControl are in sample project.i.e, in main website it self Regards, kv sekhar
mm, try qualifying the UC with it relative path like so -
<%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %>
This denotes taht "MyUserControlUC" is available in the application root folder. -
mm, try qualifying the UC with it relative path like so -
<%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %>
This denotes taht "MyUserControlUC" is available in the application root folder.Hi Dinesh,
<%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %>
is right, in the post i wrote wrong. In register tag no error. Problem with at Initilization of UserControl events in form. any suggestions is appreciated.. Thanks & regards, kv sekhar -
Hi Dinesh,
<%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %>
is right, in the post i wrote wrong. In register tag no error. Problem with at Initilization of UserControl events in form. any suggestions is appreciated.. Thanks & regards, kv sekharCan you post the exact compilation message and the reference line number? Well, I can't think of whats going wrong. Hard luck.
modified on Tuesday, February 16, 2010 5:21 AM
-
Hi All, I am deploying my website by using add webdeployment project. But in my website i have used the WebUserControls in my website. The WebUserControls events are handled in form[which contains WebUserControl] through Delegates & Event Handlers. These events of WebUserControl have been initialized at form Default.aspx Page Init event. When i build the Project it gives no errors, the site runs perfectly... But when build the Deployment project i got a compilation errors of WebUserControl events where i initilized at form Default.aspx page init event. Its giving error message like 'MyUserControlUC' could not found are u missing add reference. For sample: ========== MyUserControlUC.ascx
//delegate
public delegate void DropDownSelectedIndexChanged(object sender, EventsArgs e);
//event
public event DropDownSelectedIndexChanged IndexChanged;
//call the event
protected void ddl_items_SelectedIndex_Changed(object sender, EventsArgs e)
{
if(IndexChanged != null)
IndexChanged(sender,e);
}Default.aspx
<%@ Register TagPrefix="uc1" TagName="SampleUserControl" Src="~/MyUserControlUC.ascx" %>
Default.aspx.cs
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
InitializeComponent();
}
private void InitializeComponent()
{
this.Load += new EventHandler(this.Page_Load);
SampleUserControl1.IndexChanged += new ASP.MyUserControlUC.SelectedIndexChanged(ddl_items_SelectedIndexChanged);//Here i am getting error while building deployment project.
}private void ddl_items_SelectionIndexChanged(Object sender, EventArgs e)
{
//Code here to handle ...
}Thanks & Regards
modified on Tuesday, February 16, 2010 8:06 AM
-
Can you post the exact compilation message and the reference line number? Well, I can't think of whats going wrong. Hard luck.
modified on Tuesday, February 16, 2010 5:21 AM
Hi Dinesh, Sorry for late response... The exact error message is
1.System.Web.UI.UserControl does not contain a definition for 'IndexChanged' and no extension method 'IndexChanged' accepting a first arguement of type 'System.Web.UI.UserControl' could be found.(are u missing a using directive or an assembly reference)
2.The type or namespace name 'MyUserControlUC' doesn't exist in the namespace 'ASP' (are u missing an assembly reference?)
This error i got at Default.aspx.cs page
private void InitializeComponent() { this.Load += new EventHandler(this.Page_Load); SampleUserControl1.IndexChanged += new ASP.MyUserControlUC.SelectedIndexChanged(ddl_items_SelectedIndexChanged);//Here i am getting error while building deployment project. }
regards, kv sekhar -
Could u provide the information details whats the error or at the root itself can u specify it clealy
Hi Nath, Sorry for late response... The exact error message is
1.System.Web.UI.UserControl does not contain a definition for 'IndexChanged' and no extension method 'IndexChanged' accepting a first arguement of type 'System.Web.UI.UserControl' could be found.(are u missing a using directive or an assembly reference)
2.The type or namespace name 'MyUserControlUC' doesn't exist in the namespace 'ASP' (are u missing an assembly reference?)
This error i got at Default.aspx.cs page
private void InitializeComponent() { this.Load += new EventHandler(this.Page_Load); SampleUserControl1.IndexChanged += new ASP.MyUserControlUC.SelectedIndexChanged(ddl_items_SelectedIndexChanged);//Here i am getting error while building deployment project. }
regards, kv sekhar -
Hi Dinesh, Sorry for late response... The exact error message is
1.System.Web.UI.UserControl does not contain a definition for 'IndexChanged' and no extension method 'IndexChanged' accepting a first arguement of type 'System.Web.UI.UserControl' could be found.(are u missing a using directive or an assembly reference)
2.The type or namespace name 'MyUserControlUC' doesn't exist in the namespace 'ASP' (are u missing an assembly reference?)
This error i got at Default.aspx.cs page
private void InitializeComponent() { this.Load += new EventHandler(this.Page_Load); SampleUserControl1.IndexChanged += new ASP.MyUserControlUC.SelectedIndexChanged(ddl_items_SelectedIndexChanged);//Here i am getting error while building deployment project. }
regards, kv sekharFrom the first post, your
IndexChanged
event is of type (Delegate)DropDownSelectedIndexChanged
. Where as you are trying to assign it to a delegate of typeMyUserControlUC.SelectedIndexChanged
. You should actually be assigning it toMyUserControlUC.DropDownSelectedIndexChanged
.That is what the error message implies too. You have used the namespace qualifier "ASP
" to assign the IndexChanged event handler. Is this namespace correct?? Try the changes, it might do the trick. HTH -
From the first post, your
IndexChanged
event is of type (Delegate)DropDownSelectedIndexChanged
. Where as you are trying to assign it to a delegate of typeMyUserControlUC.SelectedIndexChanged
. You should actually be assigning it toMyUserControlUC.DropDownSelectedIndexChanged
.That is what the error message implies too. You have used the namespace qualifier "ASP
" to assign the IndexChanged event handler. Is this namespace correct?? Try the changes, it might do the trick. HTHHi Dinesh, Thanks for your response. That was not a problem, because the application is running perfectly and the dropdown event fires and giving the results to me. No errors while building and running the WebSite. But there are bulid errors while building the DeploymentProject of above website. The errors i already posted in my above post. Thanks & Regards kv sekhar
-
Could u provide the information details whats the error or at the root itself can u specify it clealy
I am developing a mail application. Through smtp I am sending mail. I work properly. Mail will send successfully. After sending mail I am display message your mail has send successfully(which is show after the mail has been send). But the problem is that when I press F5 button then mail again send. And it is sending again and again when ever I press F5 I donot want to send mail again when pressing F5 and message will also will display after mail has been send. I tray to redirect the page it solve my problem to resend the page but in this situation massage will not display. Plz can u help me