The base class includes the field 'headermain', but its type (Headermain) is not compatible with the type of control (ASP.include_headermain_ascx).


Wednesday, September 9, 2009

I had posted this question on http://forums.asp.net/

The question was

I am getting this error " The base class includes the field 'headermain', but its type (Headermain) is not compatible with the type of control (ASP.include_headermain_ascx). "


in line :

&lt;TD vAlign="top" align="left" width="100%" colSpan="2"><uc1:headermain id="headermain" runat="server"></uc1:headermain ></TD>
Please find my code :

The name space ,i am using is this 
 <%@ Register TagPrefix="uc1" TagName="Leftmain" Src="include/Leftmain.ascx" %><%@ Register TagPrefix="uc1" TagName="Leftmain" Src="include/Leftmain.ascx" %> <%@ Register TagPrefix="uc1" TagName="Headermain" Src="include/Headermain.ascx" %>
The code is 
<TD vAlign="top" align="left" width="100%" colSpan="2"><uc1:headermain id="headermain" runat="server"></uc1:headermain></TD> <TD vAlign="top" align="left" width="200" height="100%"><uc1:leftmain id="leftmain" runat="server"></uc1:leftmain></TD>   <TD vAlign="top" align="left" width="690" height="100%">     

The Solution which i got has just solved my bugs,
Please find my post on forums.asp.net at http://forums.asp.net/t/1468479.aspx

The solution i got is:
<TR>

<TD vAlign="top" align="left" width="100%" colSpan="2"><uc1:headermain runat="server"></uc1:headermain></TD>

</TR>

<TR>

<TD vAlign="top" align="left" width="200" height="100%"><uc1:leftmain runat="server"></uc1:leftmain></TD>

<TD vAlign="top" align="left" width="690" height="100%">

//-----------------------------------------------------------------------------------------------




Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

Page Authentication in C#


Friday, September 4, 2009

Hi friends,

Suppose if somebody browse some internal page of website, which require login authentication. Then mostly what happen is, the page is redirected to login page. After successfully login, user has to repeat whole cycle to reach that internal page; this is time consuming and frustrating for the visitor of the site.

The code, I am providing below, using that user don’t need to repeat whole cycle to reach that internal page, after login, User will be automatically redirected to that internal page of the website.

Code in C#:

If you are using Master page, then you should use this below code.

Put this below code in code behind of Master Page on Page_Load event

Explanation:

On login page, you might be creating Session for MemberId, suppose in below sample code, I have created Session [“AdminMemberID”] on login page on click event of submit button.

So I am just using that Session variable to compare for login authentication on master page. if user is not login and if you will try to open some internal page (Required Authentication) then below code will save that internal link in Session[“URL”] and redirect you to login page.

if (Session["AdminMemberID"] == null)

{

Session["URL"] = Request.Url.AbsoluteUri;

Response.Redirect("login.aspx");

}

                                      

[Note]: If you are not using master page then you need to keep above code to each .aspx page which requires user authentication.

Put below code on click event of Login button or submit button, which ever on your login page.

if (Session["URL"] == null)

{

Response.Redirect("Myaccount.aspx");

}

else

{

string URL = Convert.ToString(Session["URL"]);

Session.Remove("URL");

Response.Redirect(URL);

}




Hope this post will help you,
if yes please put comment below of this page,
Rajesh Singh,
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

Clear your Visual Studio Recent projects list


Tuesday, September 1, 2009

Clear your Visual Studio Recent projects list


HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\ProjectMRUList


Thankyou
Rajesh Singh
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com

Clear your Visual Studio Recent projects list




Clear your Visual Studio Recent projects list


HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\ProjectMRUList


Thankyou
Rajesh Singh
Asp.Net Developer
Indianic Infotech Ltd (India)
rajesh@indianic.com