|
Restricting web pages -- Ravindra --
Hi, I am Ravindra,currently doing a project in ASP.net(Its my First Project). My project consists of : 1.Login.aspx 2.Mymails.aspx and other web forms I want to implement authentication in my project (ie) restricting Mymails.aspx and other webforms until valid username and password are submited in Login.aspx. If any body know please help.... thanks in advance...... Ravindra |
|
-- Ravindra --
Hi, I am Ravindra,currently doing a project in ASP.net(Its my First Project). My project consists of : 1.Login.aspx 2.Mymails.aspx and other web forms I want to implement authentication in my project (ie) restricting Mymails.aspx and other webforms until valid username and password are submited in Login.aspx. If any body know please help.... thanks in advance...... Ravindra |
|
-- BradleyPeter --
If I understand your problem correctly ... Use forms authentication and apply attributes ( http://msdn2.microsoft.com/en-us/library/bfz783fz.aspx ) to the pages behind your login page that specify that a user must be logged in, in order to access the page.Peter -----Original Message----- From: DotNetDevelopment Restricting web pages Hi, I am Ravindra,currently doing a project in ASP.net(Its my First Project). My project consists of : 1.Login.aspx 2.Mymails.aspx and other web forms I want to implement authentication in my project (ie) restricting Mymails.aspx and other webforms until valid username and password are submited in Login.aspx. If any body know please help.... thanks in advance...... Ravindra |
|
-- vanikulkarni --
In login.aspx code behind, write the following code for sign-up button : if(txtUserName.text ! = "expectedusername" && txtPassword.text ! = "expectedPassword") { Response.Redirect("errorpage.aspx"); } else { Response.Redirect("Mymails.aspx"); } Here expectedusername and expectedPassword are the user name and password of the user who wants to access his mails. These can also be retrieved from the database. This is very simple code, which assumes hard coded values. Regards, Vani On 7/19/06, Ravindra <ravindradonkada> wrote: Hi, I am Ravindra,currently doing a project in ASP.net(Its my First Project). My project consists of : 1.Login.aspx 2.Mymails.aspx and other web forms I want to implement authentication in my project (ie) restricting Mymails.aspx and other webforms until valid username and password are submited in Login.aspx. If any body know please help.... thanks in advance...... Ravindra > |
|
-- raibeart --
So how do you keep them from going directly to other pages on the site? Vani Kulkarni wrote: In login.aspx code behind, write the following code for sign-up button : if(txtUserName.text ! = "expectedusername" && txtPassword.text ! = "expectedPassword") { Response.Redirect("errorpage.aspx"); } else { Response.Redirect("Mymails.aspx"); } Here expectedusername and expectedPassword are the user name and password of the user who wants to access his mails. These can also be retrieved from the database. This is very simple code, which assumes hard coded values. Regards, Vani On 7/19/06, Ravindra <ravindradonkada> wrote: > > > Hi, > I am Ravindra,currently doing a project in ASP.net(Its my First > Project). > > My project consists of : > > 1.Login.aspx > > 2.Mymails.aspx > > and other web forms > > I want to implement authentication in my project (ie) > > restricting Mymails.aspx and other webforms until valid username > > and password are submited in Login.aspx. > > If any body know please help.... > > thanks in advance...... > Ravindra > > > > > ------=_Part_108713_14803246.1153388322908 Content-Type: text/html; charset=ISO-8859-1 X-Google-AttachSize: 2220 In login.aspx code behind, <br><br>write the following code for sign-up button :<br><br>if(txtUserName.text ! = "expectedusername" && txtPassword.text ! = "expectedPassword")<br>{<br> Response.Redirect ("errorpage.aspx");<br>}<br>else<br>{<br> Response.Redirect("Mymails.aspx");<br>}<br><br>Here expectedusername and expectedPassword are the user name and password of the user who wants to access his mails. These can also be retrieved from the database. <br>This is very simple code, which assumes hard coded values.<br><br>Regards,<br>Vani<br><br><div><span class="gmail_quote">On 7/19/06, <b class="gmail_sendername">Ravindra</b> <<a href="mailto:ravindradonkada"> ravindradonkada</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hi,<br> I am Ravindra,currently doing a project in ASP.net(Its my First<br>Project).<br><br> My project consists of :<br><br> 1.Login.aspx<br><br> 2.Mymails.aspx<br><br> and other web forms<br><br> I want to implement authentication in my project (ie)<br> <br> restricting Mymails.aspx and other webforms until valid username<br><br> and password are submited in Login.aspx.<br><br> If any body know please help....<br><br> thanks in advance...... <br> Ravindra<br><br><br><br><br></blockquote></div><br> ------=_Part_108713_14803246.1153388322908-- |
|
-- Ravindra --
Vani Kulkarni wrote: In login.aspx code behind, write the following code for sign-up button : if(txtUserName.text ! = "expectedusername" && txtPassword.text ! = "expectedPassword") { Response.Redirect("errorpage.aspx"); } else { Response.Redirect("Mymails.aspx"); } Here expectedusername and expectedPassword are the user name and password of the user who wants to access his mails. These can also be retrieved from the database. This is very simple code, which assumes hard coded values. Regards, Vani On 7/19/06, Ravindra <ravindradonkada> wrote: > > > Hi, > I am Ravindra,currently doing a project in ASP.net(Its my First > Project). > > My project consists of : > > 1.Login.aspx > > 2.Mymails.aspx > > and other web forms > > I want to implement authentication in my project (ie) > > restricting Mymails.aspx and other webforms until valid username > > and password are submited in Login.aspx. > > If any body know please help.... > > thanks in advance...... > Ravindra > > > > > ------=_Part_108713_14803246.1153388322908 Content-Type: text/html; charset=ISO-8859-1 X-Google-AttachSize: 2220 In login.aspx code behind, <br><br>write the following code for sign-up button :<br><br>if(txtUserName.text ! = "expectedusername" && txtPassword.text ! = "expectedPassword")<br>{<br> Response.Redirect ("errorpage.aspx");<br>}<br>else<br>{<br> Response.Redirect("Mymails.aspx");<br>}<br><br>Here expectedusername and expectedPassword are the user name and password of the user who wants to access his mails. These can also be retrieved from the database. <br>This is very simple code, which assumes hard coded values.<br><br>Regards,<br>Vani<br><br><div><span class="gmail_quote">On 7/19/06, <b class="gmail_sendername">Ravindra</b> <<a href="mailto:ravindradonkada"> ravindradonkada</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hi,<br> I am Ravindra,currently doing a project in ASP.net(Its my First<br>Project).<br><br> My project consists of :<br><br> 1.Login.aspx<br><br> 2.Mymails.aspx<br><br> and other web forms<br><br> I want to implement authentication in my project (ie)<br> <br> restricting Mymails.aspx and other webforms until valid username<br><br> and password are submited in Login.aspx.<br><br> If any body know please help....<br><br> thanks in advance...... <br> Ravindra<br><br><br><br><br></blockquote></div><br> ------=_Part_108713_14803246.1153388322908-- |
|
-- vanikulkarni --
If you want users to be restricted from going to other pages without signing in, then you can do the following: Redirect the user to login page whenever he/she types the URL of the page he/she wants to visit. Once logged in, store the user attributes i.e. user_id and pwd in session, and keep checking session. If session is expired then redirect user to login page, else he can keep browsing your application. Regards, Vani On 7/20/06, raibeart <raibeart> wrote: So how do you keep them from going directly to other pages on the site? Vani Kulkarni wrote: > In login.aspx code behind, > > write the following code for sign-up button : > > if(txtUserName.text ! = "expectedusername" && txtPassword.text ! = > "expectedPassword") > { > Response.Redirect("errorpage.aspx"); > } > else > { > Response.Redirect("Mymails.aspx"); > } > > Here expectedusername and expectedPassword are the user name and password > of the user who wants to access his mails. These can also be retrieved from > the database. > This is very simple code, which assumes hard coded values. > > Regards, > Vani > > On 7/19/06, Ravindra <ravindradonkada> wrote: > > > > > > Hi, > > I am Ravindra,currently doing a project in ASP.net(Its my First > > Project). > > > > My project consists of : > > > > 1.Login.aspx > > > > 2.Mymails.aspx > > > > and other web forms > > > > I want to implement authentication in my project (ie) > > > > restricting Mymails.aspx and other webforms until valid username > > > > and password are submited in Login.aspx. > > > > If any body know please help.... > > > > thanks in advance...... > > Ravindra > > > > > > > > > > > ------=_Part_108713_14803246.1153388322908 > Content-Type: text/html; charset=ISO-8859-1 > X-Google-AttachSize: 2220 > > In login.aspx code behind, <br><br>write the following code for sign-up button :<br><br>if(txtUserName.text ! = "expectedusername" && txtPassword.text ! = "expectedPassword")<br>{<br> Response.Redirect > ("errorpage.aspx");<br>}<br>else<br>{<br> Response.Redirect("Mymails.aspx");<br>}<br><br>Here expectedusername and expectedPassword are the user name and password of the user who wants to access his mails. These can also be retrieved from the database. > <br>This is very simple code, which assumes hard coded values.<br><br>Regards,<br>Vani<br><br><div><span class="gmail_quote">On 7/19/06, <b class="gmail_sendername">Ravindra</b> <<a href="mailto: ravindradonkada"> > ravindradonkada</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hi,<br> I am Ravindra,currently doing a project in > ASP.net(Its my First<br>Project).<br><br> My project consists of :<br><br> 1.Login.aspx<br><br> 2.Mymails.aspx<br><br> and other web forms<br><br> I want to implement authentication in my project (ie)<br> > <br> restricting Mymails.aspx and other webforms until valid username<br><br> and password are submited in Login.aspx.<br><br> If any body know please help....<br><br> thanks in advance...... > <br> Ravindra<br><br><br><br><br></blockquote></div><br> > > ------=_Part_108713_14803246.1153388322908-- > |
|
-- Ravindra --
thank u very much..... but is it possible with web.config -Ravindra |
|
-- MilindChavan --
Create varible for user Name and Password in web.config file and acces thiss variable key value On 7/21/06, Ravindra <ravindradonkada> wrote: thank u very much..... but is it possible with web.config -Ravindra > -- Milind R. Chavan Software Developer Nexeia Technologies Pvt. Ltd. Mumbai - 80 |
|
-- raibeart --
So, can you give an example of how to do this. Sorry, but this is something that I have never done before and I have no idea where to start on it. I do know the general principle. Vani Kulkarni wrote: If you want users to be restricted from going to other pages without signing in, then you can do the following: Redirect the user to login page whenever he/she types the URL of the page he/she wants to visit. Once logged in, store the user attributes i.e. user_id and pwd in session, and keep checking session. If session is expired then redirect user to login page, else he can keep browsing your application. Regards, Vani On 7/20/06, raibeart <raibeart> wrote: > > > So how do you keep them from going directly to other pages on the site? > > > Vani Kulkarni wrote: > > In login.aspx code behind, > > > > write the following code for sign-up button : > > > > if(txtUserName.text ! = "expectedusername" && txtPassword.text ! = > > "expectedPassword") > > { > > Response.Redirect("errorpage.aspx"); > > } > > else > > { > > Response.Redirect("Mymails.aspx"); > > } > > > > Here expectedusername and expectedPassword are the user name and > password > > of the user who wants to access his mails. These can also be retrieved > from > > the database. > > This is very simple code, which assumes hard coded values. > > > > Regards, > > Vani > > > > On 7/19/06, Ravindra <ravindradonkada> wrote: > > > > > > > > > Hi, > > > I am Ravindra,currently doing a project in ASP.net(Its my First > > > Project). > > > > > > My project consists of : > > > > > > 1.Login.aspx > > > > > > 2.Mymails.aspx > > > > > > and other web forms > > > > > > I want to implement authentication in my project (ie) > > > > > > restricting Mymails.aspx and other webforms until valid username > > > > > > and password are submited in Login.aspx. > > > > > > If any body know please help.... > > > > > > thanks in advance...... > > > Ravindra > > > > > > > > > > > > > > > > > ------=_Part_108713_14803246.1153388322908 > > Content-Type: text/html; charset=ISO-8859-1 > > X-Google-AttachSize: 2220 > > > > In login.aspx code behind, <br><br>write the following code for sign-up > button :<br><br>if(txtUserName.text ! = "expectedusername" > && txtPassword.text ! = > "expectedPassword")<br>{<br> Response.Redirect > > ("errorpage.aspx");<br>}<br>else<br>{<br> > Response.Redirect("Mymails.aspx");<br>}<br><br>Here > expectedusername and expectedPassword are the user name and password > of the user who wants to access his mails. These can also be retrieved from > the database. > > <br>This is very simple code, which assumes hard coded > values.<br><br>Regards,<br>Vani<br><br><div><span class="gmail_quote">On > 7/19/06, <b class="gmail_sendername">Ravindra</b> <<a href="mailto: > ravindradonkada"> > > ravindradonkada</a>> wrote:</span><blockquote > class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); > margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hi,<br> I am > Ravindra,currently doing a project in > > ASP.net(Its my First<br>Project).<br><br> My > project consists of > :<br><br> 1.Login.aspx<br><br> 2.Mymails.aspx<br><br> and > other web forms<br><br> I want to > implement authentication in my project (ie)<br> > > <br> restricting Mymails.aspx and other webforms > until valid username<br><br> and password are > submited in Login.aspx.<br><br> > If any body know please > help....<br><br> thanks > in advance...... > > > <br> Ravindra<br><br><br><br><br></blockquote></div><br> > > > > ------=_Part_108713_14803246.1153388322908-- > > > > > ------=_Part_123126_17002199.1153464366067 Content-Type: text/html; charset=ISO-8859-1 X-Google-AttachSize: 6890 If you want users to be restricted from going to other pages without signing in, then you can do the following:<br>Redirect the user to login page whenever he/she types the URL of the page he/she wants to visit. Once logged in, store the user attributes i.e. user_id and pwd in session, and keep checking session. If session is expired then redirect user to login page, else he can keep browsing your application.<br><br>Regards, <br>Vani<br><br><div><span class="gmail_quote"> On 7/20/06, <b class="gmail_sendername">raibeart</b> <<a href="mailto:raibeart">raibeart</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <br>So how do you keep them from going directly to other pages on the site?<br><br><br>Vani Kulkarni wrote:<br>> In login.aspx code behind,<br>><br>> write the following code for sign-up button :<br>><br>> if( txtUserName.text ! = "expectedusername" && txtPassword.text ! =<br>> "expectedPassword")<br>> {<br>> Response.Redirect("errorpage.aspx");<br>> }<br>> else<br>> {<br> > Response.Redirect("Mymails.aspx");<br>> }<br>><br>> Here expectedusername and expectedPassword are the user name and password<br>> of the user who wants to access his mails. These can also be retrieved from <br>> the database.<br>> This is very simple code, which assumes hard coded values.<br>><br>> Regards,<br>> Vani<br>><br>> On 7/19/06, Ravindra <<a href="mailto:ravindradonkada">ravindradonkada </a>> wrote:<br>> ><br>> ><br>> > Hi,<br>> > I am Ravindra,currently doing a project in ASP.net(Its my First<br>> > Project).<br>> ><br>> > My project consists of :<br>> > <br>> > 1.Login.aspx<br>> ><br>> > 2.Mymails.aspx<br>> ><br>> > and other web forms<br>> ><br>> > I want to implement authentication in my project (ie)<br>> > <br>> > restricting Mymails.aspx and other webforms until valid username<br>> ><br>> > and password are submited in Login.aspx.<br>> ><br>> > If any body know please help.... <br>> ><br>> > thanks in advance......<br>> > Ravindra<br>> ><br>> ><br>> > ><br>> ><br>><br>> ------=_Part_108713_14803246.1153388322908 <br>> Content-Type: text/html; charset=ISO-8859-1<br>> X-Google-AttachSize: 2220<br>><br>> In login.aspx code behind, <br><br>write the following code for sign-up button :<br><br>if(txtUserName.text ! = &quot;expectedusername&quot; &amp;&amp; txtPassword.text ! = &quot;expectedPassword&quot;)<br>{<br>&nbsp;&nbsp; Response.Redirect<br>> (&quot;errorpage.aspx&quot;);<br>}<br>else<br>{<br>&nbsp; Response.Redirect(&quot;Mymails.aspx&quot;);<br>}<br><br>Here&nbsp; expectedusername and expectedPassword are the user name&nbsp; and password of the user who wants to access his mails. These can also be retrieved from the database. <br>> <br>This is very simple code, which assumes hard coded values.<br><br>Regards,<br>Vani<br><br><div><span class="gmail_quote">On 7/19/06, <b class="gmail_sendername">Ravindra</b> &lt;<a href="mailto: <a href="mailto:ravindradonkada">ravindradonkada</a>"><br>> <a href="mailto:ravindradonkada">ravindradonkada</a></a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>Hi,<br>&nbsp;&nbsp;I am Ravindra,currently doing a project in<br>> ASP.net(Its my First<br>Project).<br><br>&nbsp;&nbsp;&nbsp;&nbsp; My project consists of :<br><br>&nbsp;&nbsp;&nbsp;&nbsp;1.Login.aspx<br><br>&nbsp;&nbsp;&nbsp;&nbsp;2.Mymails.aspx<br><br>&nbsp;&nbsp;&nbsp;&nbsp;and other web forms<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I want to implement authentication in my project (ie)<br> <br>> <br>&nbsp;&nbsp;&nbsp;&nbsp; restricting Mymails.aspx and other webforms until valid username<br><br>&nbsp;&nbsp;&nbsp;&nbsp; and password are submited in Login.aspx .<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If any body know please help....<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;thanks in advance...... <br>> <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ravindra<br><br><br><br><br></blockquote></div><br> <br>><br>> ------=_Part_108713_14803246.1153388322908--<br><br><br> ------=_Part_123126_17002199.1153464366067-- |