Avoiding login page

E

egsdar

Hi, I have a web page that i don't want to have the same behaviors than the
other ones, for instance, when an user tries to goes to a page directly
without login it redirects him to the login page, but I have one that I don't
want to have this behavior, how can i do that?



Thanks

P.S.: I'm not using the ASP.net configuration to deal with users, but
they're login against a table that I build.
 
S

Scott M.

On the page that users can get to without logging in, simply don't redirect
them away from the page.

Am I missing something? This seems rather clear.
 
Joined
Mar 23, 2009
Messages
8
Reaction score
0
Am I right in saying that you dont want to be re-directed to login.aspx when they encounter a members only page, you want them to be directed to a different page (say default.aspx for example).

If so, your best bet might be to set a flag when this re-direct occurs, so that you are re-directed fo the login.aspx page, and then to another page (which is kindof ghetto, yes). There is the Response.redirect("URL HERE") command that you can use to make this happen. I dont know if there is a more elegant way of making this happen, ASP.net likes to make their "helper" actions quite cast-iron.
 
E

Eliyahu Goldin

You can to setup locations with separate authorization rules.

For example, you can have forms authentication for the whole site:

<authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" loginUrl="~/Login.aspx" />
</authentication>


and allow direct access to all pages in File/Transfer directory:

<!--Allow access to Files directory for file transfer-->
<location path="Files/Transfer">
<system.web>
<authorization>
<allow users="*"/>
</authorization>
</system.web>
</location>
 
E

Eliyahu Goldin

<location path="yourpage.aspx"> is wrong. path whould point to a directory,
not to a page. Make a separate folder for the pages you want to exempt.
 
E

egsdar

I tried but nothing yet, this is my web config file:

This is my webconfig file:



1 <?xml version="1.0"?>
2 <configuration>
3 <configSections>
4 <sectionGroup name="system.web.extensions"
type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35">
5 <sectionGroup name="scripting"
type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
6 <section name="scriptResourceHandler"
type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" requirePermission="false"
allowDefinition="MachineToApplication"/>
7 <sectionGroup name="webServices"
type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35">
8 <section name="jsonSerialization"
type="System.Web.Configuration.ScriptingJsonSerializationSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" requirePermission="false"
allowDefinition="Everywhere"/>
9 <section name="profileService"
type="System.Web.Configuration.ScriptingProfileServiceSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" requirePermission="false"
allowDefinition="MachineToApplication"/>
10 <section name="authenticationService"
type="System.Web.Configuration.ScriptingAuthenticationServiceSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" requirePermission="false"
allowDefinition="MachineToApplication"/>
11 </sectionGroup>
12 </sectionGroup>
13 </sectionGroup>
14 </configSections>
15 <connectionStrings>
16 <add name="SIPConnectionString" connectionString="Data
Source=DB2FX981\COMWARE;Initial Catalog=SIP;Integrated Security=True"
17 providerName="System.Data.SqlClient" />
18 <add name="OLEDBConnectionString"
connectionString="Provider=SQLOLEDB;Data Source=DB2FX981\COMWARE;Integrated
Security=SSPI;Initial Catalog=SIP"
19 providerName="System.Data.OleDb" />
20 </connectionStrings>
21 <system.web>
22 <pages>
23 <controls>
24 <add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
25 <add namespace="AjaxControlToolkit"
assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
26 </controls>
27 </pages>
28 <!--
29 Set compilation debug="true" to insert debugging
30 symbols into the compiled page. Because this
31 affects performance, set this value to true only
32 during development.
33 -->
34 <compilation debug="true">
35 <assemblies>
36 <add assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
37 <add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A" />
38 <add assembly="System.Web.Extensions.Design,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
39 <add assembly="System.Windows.Forms, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089" />
40 </assemblies>
41 <buildProviders>
42 <add extension=".rdlc"
type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common,
Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
43 </buildProviders>
44 </compilation>
45 <httpHandlers>
46 <remove path="*.asmx" verb="*" />
47 <add path="*.asmx" verb="*"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
48 validate="false" />
49 <add path="*_AppService.axd" verb="*"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
50 validate="false" />
51 <add path="ScriptResource.axd" verb="GET,HEAD"
type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
52 validate="false" />
53 <add path="Reserved.ReportViewerWebControl.axd" verb="*"
type="Microsoft.Reporting.WebForms.HttpHandler,
Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
54 validate="false" />
55 </httpHandlers>
56 <httpModules>
57 <add name="ScriptModule" type="System.Web.Handlers.ScriptModule,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
58 </httpModules>
59 </system.web>
60 <system.webServer>
61 <validation validateIntegratedModeConfiguration="false"/>
62 <modules>
63 <add name="ScriptModule" preCondition="integratedMode"
type="System.Web.Handlers.ScriptModule, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
64 </modules>
65 <handlers>
66 <remove name="WebServiceHandlerFactory-Integrated"/>
67 <add name="ScriptHandlerFactory" verb="*" path="*.asmx"
preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
68 <add name="ScriptHandlerFactoryAppServices" verb="*"
path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
69 <add name="ScriptResource" preCondition="integratedMode"
verb="GET,HEAD" path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
70 </handlers>
71 </system.webServer>
72 <system.net>
73 <mailSettings>
74 <smtp>
75 <network host="antispam.cols.com.co"/>
76 </smtp>
77 </mailSettings>
78 </system.net>
79 <location path="Ex">
80 <system.web>
81 <authorization>
82 <allow users="*"/>
83 </authorization>
84 </system.web>
85 </location>
86 </configuration>
87

Hope you find something wrong with it.

Eliyahu Goldin said:
<location path="yourpage.aspx"> is wrong. path whould point to a directory,
not to a page. Make a separate folder for the pages you want to exempt.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin


egsdar said:
Actually I did that already, but did not work.
Any other suggestion?
 
G

Guest

I tried but nothing yet, this is my web config file:

This is my webconfig file:

1    <?xml version="1.0"?>
2    <configuration>
3      <configSections>
4        <sectionGroup name="system.web.extensions"
type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35">
5          <sectionGroup name="scripting"
type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
6            <section name="scriptResourceHandler"
type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" requirePermission="false"
allowDefinition="MachineToApplication"/>
7            <sectionGroup name="webServices"
type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35">
8              <section name="jsonSerialization"
type="System.Web.Configuration.ScriptingJsonSerializationSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" requirePermission="false"
allowDefinition="Everywhere"/>
9              <section name="profileService"
type="System.Web.Configuration.ScriptingProfileServiceSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" requirePermission="false"
allowDefinition="MachineToApplication"/>
10             <section name="authenticationService"
type="System.Web.Configuration.ScriptingAuthenticationServiceSection,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35" requirePermission="false"
allowDefinition="MachineToApplication"/>
11           </sectionGroup>
12         </sectionGroup>
13       </sectionGroup>
14     </configSections>
15     <connectionStrings>
16       <add name="SIPConnectionString" connectionString="Data
Source=DB2FX981\COMWARE;Initial Catalog=SIP;Integrated Security=True"
17      providerName="System.Data.SqlClient" />
18       <add name="OLEDBConnectionString"
connectionString="Provider=SQLOLEDB;Data Source=DB2FX981\COMWARE;Integrated
Security=SSPI;Initial Catalog=SIP"
19      providerName="System.Data.OleDb" />
20     </connectionStrings>
21     <system.web>
22       <pages>
23         <controls>
24           <add tagPrefix="asp" namespace="System.Web.UI"
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
25           <add namespace="AjaxControlToolkit"
assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
26         </controls>
27       </pages>
28       <!--
29             Set compilation debug="true" to insert debugging
30             symbols into the compiled page. Because this
31             affects performance, set this value to true only
32             during development.
33       -->
34       <compilation debug="true">
35         <assemblies>
36           <add assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
37           <add assembly="System.Design, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=B03F5F7F11D50A3A" />
38           <add assembly="System.Web.Extensions.Design,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
39           <add assembly="System.Windows.Forms, Version=2..0.0.0,
Culture=neutral, PublicKeyToken=B77A5C561934E089" />
40         </assemblies>
41         <buildProviders>
42           <add extension=".rdlc"
type="Microsoft.Reporting.RdlBuildProvider, Microsoft.ReportViewer.Common,
Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
43         </buildProviders>
44       </compilation>
45       <httpHandlers>
46         <remove path="*.asmx" verb="*" />
47         <add path="*.asmx" verb="*"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
48           validate="false" />
49         <add path="*_AppService.axd" verb="*"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
50           validate="false" />
51         <add path="ScriptResource.axd" verb="GET,HEAD"
type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
52           validate="false" />
53         <add path="Reserved.ReportViewerWebControl.axd" verb="*"
type="Microsoft.Reporting.WebForms.HttpHandler,
Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
54           validate="false" />
55       </httpHandlers>
56       <httpModules>
57         <add name="ScriptModule" type="System.Web.Handlers..ScriptModule,
System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35"/>
58       </httpModules>
59     </system.web>
60     <system.webServer>
61       <validation validateIntegratedModeConfiguration="false"/>
62       <modules>
63         <add name="ScriptModule" preCondition="integratedMode"
type="System.Web.Handlers.ScriptModule, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
64       </modules>
65       <handlers>
66         <remove name="WebServiceHandlerFactory-Integrated"/>
67         <add name="ScriptHandlerFactory" verb="*" path="*.asmx"
preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
68         <add name="ScriptHandlerFactoryAppServices" verb="*"
path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
69         <add name="ScriptResource" preCondition="integratedMode"
verb="GET,HEAD" path="ScriptResource.axd"
type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions,
Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
70       </handlers>
71     </system.webServer>
72     <system.net>
73       <mailSettings>
74         <smtp>
75           <network host="antispam.cols.com.co"/>
76         </smtp>
77       </mailSettings>
78     </system.net>
79   <location path="Ex">
80         <system.web>
81            <authorization>
82               <allow users="*"/>
83            </authorization>
84         </system.web>
85   </location>
86   </configuration>
87  

Hope you find something wrong with it.



Eliyahu Goldin said:
<location path="yourpage.aspx"> is wrong. path whould point to a directory,
not to a page. Make a separate folder for the pages you want to exempt.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin

- Zitierten Text anzeigen -

Is your problem already solved or you still need help?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,174
Latest member
BlissKetoACV
Top