Click here to Skip to main content
11,721,385 members (82,018 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
I am redirecting using different roles superadmin,hr assistant etc to aspx pages with in folders respectively..But in server it keeps me redirecting as zainasoft/Account/Login.aspx?ReturnUrl=%2fzainasoft%2fHRManager%2fDashboard.aspx ....

I am actualy redirecting to HRManager/Dashboard.aspx......
My web.config as follows:
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
	<configsections>
		<sectiongroup name="devExpress">
			<section name="settings" type="DevExpress.Web.ASPxClasses.SettingsConfigurationSection, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirepermission="false" />
			<section name="compression" type="DevExpress.Web.ASPxClasses.CompressionConfigurationSection, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirepermission="false" />
			<section name="themes" type="DevExpress.Web.ASPxClasses.ThemesConfigurationSection, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirepermission="false" />
			<section name="errors" type="DevExpress.Web.ASPxClasses.ErrorsConfigurationSection, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" requirepermission="false" />
		</sectiongroup>
		<sectiongroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
			<section name="ResumeManager.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirepermission="false" />
		</sectiongroup>
	</configsections>
	<appsettings>
		&lt;!--<add key="connect" value="server=ZS-SERVER;Initial Catalog=ResumeNakilat;User ID=sa;Password=star@123;Connect Timeout=200; pooling='true';Max Pool Size=200" />--&gt;
		&lt;!--<add key="connect" value="server=ZS-SERVER;Initial Catalog=resumedbzaina;User ID=sa;Password=star@123;Connect Timeout=200; pooling='true';Max Pool Size=200" />--&gt;
		<add key="connect" value="server=SOUTHERN-PC;Initial Catalog=resumedbzaina;User ID=sa;Password=sa;Connect Timeout=200; pooling='true';Max Pool Size=200" />
		&lt;!--<add key="connects" value="server=ZS-SERVER;Initial Catalog=resumedbzaina;User ID=sa;Password=star@123" />--&gt;
    <add key="connects" value="server=SOUTHERN-PC;Initial Catalog=resumedbzaina;User ID=sa;Password=sa" />
		<add key="SMTPServer" value="mail.zainasoft.com" />
		<add key="FromAddressInfo" value="careers@zainasoft.com" />
		<add key="SMTPCredentialUser" value="careers@zainasoft.com" />
		<add key="SMTPCredentialPass" value="password" />
    <add key="autoFormsAuthentication" value="false" />
    <add key="enableSimpleMembership" value="false" />
		<add key="MailBee.Global.LicenseKey" value="MN700-0123456789ABCDEF-0123" />
		<add key="ChartImageHandler" value="storage=file;timeout=20;" />
		<add key="FolderPath" value="RecruiterCandidatedocs" />
	</appsettings>
	<connectionstrings>
  <add name="ConnectionString" connectionstring="Data Source=SOUTHERN-PC;Initial Catalog=resumedbzaina;User ID=sa;Password=sa;Connect Timeout=200; pooling='true'; Max Pool Size=200">
   providerName="System.Data.SqlClient" /&gt;
  <add name="ApplicationServices" connectionstring="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true">
   providerName="System.Data.SqlClient" /&gt;
  <add name="resumedbzainaConnectionString" connectionstring="Data Source=ZS-SERVER;Initial Catalog=resumedbzaina;User ID=sa">
   providerName="System.Data.SqlClient" /&gt;
  <add name="resumedbzainaConnectionString1" connectionstring="Data Source=ZS-SERVER;Initial Catalog=resumedbzaina;Persist Security Info=True;User ID=sa;Password=star@123">
   providerName="System.Data.SqlClient" /&gt;
  <add name="ConnectionString2" connectionstring="Expression: XtraCarsConnectionString">
   providerName="System.Data.SqlClient" /&gt;
  <add name="resumedbzainaConnectionString2" connectionstring="Data Source=ZS-SERVER;Initial Catalog=resumedbzaina;User ID=sa;Password=star@123">
   providerName="System.Data.SqlClient" /&gt;
  <add name="resumedbzainaConnectionString3" connectionstring="Data Source=FAIZREHAN-PC\SQLEXPRESS;Initial Catalog=resumedbzaina;Persist Security Info=True;User ID=sa">
   providerName="System.Data.SqlClient" /&gt;
  <add name="resumedbzainaConnectionString4" connectionstring="Data Source=SOUTHERN-PC;Initial Catalog=resumedbzaina;User ID=sa;Password=sa">
   providerName="System.Data.SqlClient" /&gt;
 </add></add></add></add></add></add></add></add></connectionstrings>
	<system.web>
    <identity impersonate="true" />
		<pages controlrenderingcompatibilityversion="3.5" validaterequest="false" clientidmode="AutoID">
			<controls>
				<add tagprefix="asp" namespace="System.Web.UI.DataVisualization.Charting" assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
			</controls>
		</pages>
		<sessionstate mode="InProc" timeout="525600"></sessionstate>
		<customerrors mode="Off" />
		<compilation debug="true" targetframework="4.0">
			<assemblies>
				<add assembly="DevExpress.Web.ASPxEditors.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Web.ASPxThemes.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Data.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.XtraReports.v12.1.Web, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
				<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
				<add assembly="DevExpress.Printing.v12.1.Core, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.XtraReports.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Utils.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.XtraCharts.v12.1.Web, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Web.ASPxEditors.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Data.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.Web.ASPxGridView.v12.1.Export, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.XtraPrinting.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
				<add assembly="DevExpress.Web.ASPxScheduler.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" />
				<add assembly="DevExpress.XtraScheduler.v12.1.Core, Version=12.1.6.0, Culture=neutral, PublicKeyToken=B88D1754D700E49A" /></assemblies>
		</compilation>
		<authentication mode="Forms">
			&lt;forms loginUrl="~/Account/Login.aspx" timeout="2880"/&gt;
		</authentication>
		<membership defaultprovider="AspNetSqlMembershipProviderRelaxed">
			<providers>
				<clear />
				<add connectionstringname="ConnectionString" applicationname="/" maxinvalidpasswordattempts="10" enablepasswordretrieval="false" enablepasswordreset="true" requiresquestionandanswer="false" passwordstrengthregularexpression="" minrequiredpasswordlength="1" minrequirednonalphanumericcharacters="0" name="AspNetSqlMembershipProviderRelaxed" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
			</providers>
		</membership>
		<rolemanager enabled="true">
			<providers>
				<clear />
				<remove name="AspNetSqlRoleProvider" />
				<add name="AspNetSqlRoleProvider" connectionstringname="ConnectionString" applicationname="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
			</providers>
		</rolemanager>
		<httpruntime requestvalidationmode="2.0" maxrequestlength="102400" executiontimeout="3600" />
		<httpmodules>
			<add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule" />
		</httpmodules>
		<httphandlers>
			<add path="ChartImg.axd" verb="GET,HEAD,POST" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
			<add path="ASPxUploadProgressHandlerPage.ashx" verb="GET,POST" type="DevExpress.Web.ASPxUploadControl.ASPxUploadProgressHttpHandler, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" validate="false" />
			<add path="DX.ashx" verb="GET,POST" type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" validate="false" />
		</httphandlers>
	</system.web>
	<system.webserver>
		<defaultdocument enabled="true">
			<files>
				<clear />
				<add value="Login.aspx" />
			</files>
		</defaultdocument>
		<modules runallmanagedmodulesforallrequests="true">
			<add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" name="ASPxHttpHandlerModule" />
		</modules>
		<validation validateintegratedmodeconfiguration="false" />
		<handlers>
			<remove name="ChartImageHandler" />
			<add type="DevExpress.Web.ASPxUploadControl.ASPxUploadProgressHttpHandler, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" verb="GET,POST" path="ASPxUploadProgressHandlerPage.ashx" name="ASPxUploadProgressHandler" precondition="integratedMode" />
			<add type="DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, DevExpress.Web.v12.1, Version=12.1.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" verb="GET,POST" path="DX.ashx" name="ASPxHttpHandlerModule" precondition="integratedMode" />
			<add name="ChartImageHandler" precondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
		</handlers>
		<httpprotocol>
			<customheaders>
				<clear />
				<add name="X-UA-Compatible" value="IE=9" />
			</customheaders>
		</httpprotocol>
	</system.webserver>
	<devexpress>
		<settings righttoleft="false" />
		<compression enablehtmlcompression="false" enablecallbackcompression="true" enableresourcecompression="true" enableresourcemerging="false" />
		<themes enablethemesassembly="true" stylesheettheme="" theme="" />
		<errors callbackerrorredirecturl="" />
	</devexpress>
	<applicationsettings>
		<resumemanager.properties.settings>
			<setting name="ResumeManager_localhost_WebService1" serializeas="String">
				<value>http://localhost:51919/WebService1.asmx</value>
			</setting>
		</resumemanager.properties.settings>
	</applicationsettings>
</configuration>
Posted 15-Feb-13 21:27pm
Edited 16-Feb-13 1:11am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

1st of All I'd like to suggest you not to provide the whole original config file in forums.
Also for better understanding of your question we just need the FormsAuthentication code lines, not anything else.

Anyway what I'm getting from your problem, you want to redirect to different pages according to different Roles.
SO if I'm right I think the following code block can help you.

protected void Button1_Click(object sender, EventArgs e)
    {
        //You can Implement Logic to check which User/Role is Logging In as well
        if (Request.Params["ReturnUrl"] != null)
        {
            FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, false);
        }
        else
        {
            FormsAuthentication.SetAuthCookie(txtUserName.Text, false);
            Response.Redirect("HRManager/Dashboard.aspx");
        }
    }

Still you didn't get anything Feel Free to ask.

Regards
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 440
1 OriginalGriff 229
2 Mika Wendelius 170
3 F-ES Sitecore 80
4 cyycoish 70
0 Sergey Alexandrovich Kryukov 2,209
1 OriginalGriff 969
2 F-ES Sitecore 660
3 Maciej Los 609
4 Richard MacCutchan 560


Advertise | Privacy | Mobile
Web02 | 2.8.150901.1 | Last Updated 17 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100