The title pretty much says my problem.
I have a .aspx main page
- index.aspx.cs
public partial class IndexPageClass : System.Web.UI.Page
{
public string m_strCustomerName = "abc";
.
.
.
}
- In index.aspx, I need to display it in a list.
<%@ Register Src="signin.ascx" TagName="signin" TagPrefix="uc2" %>
<li><b><a>Hi, <%=m_strCustomerName%></a></b></li>
So in my signin.ascx user control, when the customer logs in, I will get the customer name and want to update it in main index.aspx page. But I haven't found an easy way to do it except to use session variable which is kinda strange to me. (It should work though)
Casting doesn't work.
IndexPageClass bp = (IndexPageClass)this.Page;
Error I got:
"Unable to cast object of type 'ASP.index_aspx' to type 'IndexPageClass'.
Description: An unhandled exception occurred during the execution of the current web request. Exception Details: System.InvalidCastException: Unable to cast object of type 'ASP.index_aspx' to type 'IndexPageClass'."
I know 'ASP.index_aspx' is a class created by .Net:
public class index_aspx : global::thebcguide.IndexPageClass, System.Web.IHttpHandler
Is there any way I can cast or access my 'IndexPageClass' class? I am frustrated. Any serious help would be appreciated.
I have a .aspx main page
- index.aspx.cs
public partial class IndexPageClass : System.Web.UI.Page
{
public string m_strCustomerName = "abc";
.
.
.
}
- In index.aspx, I need to display it in a list.
<%@ Register Src="signin.ascx" TagName="signin" TagPrefix="uc2" %>
<li><b><a>Hi, <%=m_strCustomerName%></a></b></li>
So in my signin.ascx user control, when the customer logs in, I will get the customer name and want to update it in main index.aspx page. But I haven't found an easy way to do it except to use session variable which is kinda strange to me. (It should work though)
Casting doesn't work.
IndexPageClass bp = (IndexPageClass)this.Page;
Error I got:
"Unable to cast object of type 'ASP.index_aspx' to type 'IndexPageClass'.
Description: An unhandled exception occurred during the execution of the current web request. Exception Details: System.InvalidCastException: Unable to cast object of type 'ASP.index_aspx' to type 'IndexPageClass'."
I know 'ASP.index_aspx' is a class created by .Net:
public class index_aspx : global::thebcguide.IndexPageClass, System.Web.IHttpHandler
Is there any way I can cast or access my 'IndexPageClass' class? I am frustrated. Any serious help would be appreciated.