C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




how to run the pages which does not required login using form authentication


Posted Date: 29 Aug 2008      Total Responses: 3

Posted By: Sweety       Member Level: Silver     Points: 1


Hello all,

I am using FormsAuthentication.But now I want to run those pages which does not require login using FormsAuthentication.

Right now I have set Login.aspx in the web.config.So, if I try to run the page which does not require login, it first goes to the login page only.

Could any one please tell me how do I run those pages which does not require login when I am using forms authentication?

Thanks




Responses

Author: Praveen    29 Aug 2008Member Level: GoldRating:     Points: 4
<authentication mode="Forms" >
<forms loginUrl="login.aspx" timeout="30" />
</authentication>
<authorization>
<deny users="?" />
</authorization>

Comment this lines in ur web.config

i hope this will help u


Author: Legend     29 Aug 2008Member Level: SilverRating:     Points: 6
ok, first you can check your system username and , if can fetch the user name and you no need to run the login form,

you can fetch the user name like

string UserName = "";
UserName = User.Identity.Name;
if (Convert.ToInt32(UserName.IndexOf("\\")) > 0)
{
UserName = UserName.Remove(0, Convert.ToInt32(UserName.IndexOf("\\") + 1));
}
Session["get"] = UserName;


and ADD the new empty form(Write the below code into that form(dont put any controls))



//Dataset here(that is connection to DATABASE)
if (ds != null)
{
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
DataRow Rw = ds.Tables[0].Rows[0];
if (Rw != null)
{
Session["AccessType"] = Rw["Fk_AccessType"].ToString();
UserAvailable = true;
}


}
}
}

if (UserAvailable)
{
if ((Session["AccessType"].ToString()) == "3")
{
Response.Redirect("Helpdesk_EmployeeRequestDetails.aspx");
}
else if ((Session["AccessType"].ToString()) == "2")
{
Response.Redirect("Helpdesk_Assign.aspx");
}
else if ((Session["AccessType"].ToString()) == "1")
{
Response.Redirect("Helpdesk_Assign.aspx");
}

}
else
{
// if ((Session["AccessType"].ToString()) != "1" || (Session["AccessType"].ToString()) != "2" || (Session["AccessType"].ToString()) != "3")
//{
Response.Redirect("Helpdesk_Endpage.aspx");//This is page displys(User is not authorised person to view this page)
// }
}



Thanks ,
is this helpful?
if it is helpful, reply how it is?



Author: raghunath    29 Aug 2008Member Level: BronzeRating:     Points: 0



login.txt
Post Reply
You must Sign In to post a response.
Next : Query Problem
Previous : what is linq and what are the adv in linq?.
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

web conferencing services

Contact Us    Privacy Policy    Terms Of Use