I've placed <forms loginUrl="home.aspx"></forms> in web.config and now all users that log in go to default.aspx

I've placed <forms loginUrl="home.aspx"></forms> in web.config and now all users that log in go to default.aspx.

       <authentication mode="Forms">
        <forms loginUrl="home.aspx"></forms>
      </authentication>

What attribute I should add, to make the user stay on the same page. Btw when I remove  <forms loginUrl="home.aspx"></forms>, users stay on the same page after login.

Thanks.

0
LastManStanding
1/26/2009 6:14:44 AM
asp.net.security 27051 articles. 1 followers. Follow

6 Replies
1964 Views

Similar Articles

[PageSpeed] 4
Get it on Google Play
Get it on Apple App Store

try one of these..

<authentication mode="Forms">
        <forms loginUrl="home.aspx" defaultUrl="home.aspx"></forms>
      </authentication>

Set the default start page for your website at home.aspx

when you login first time... you can Redirect your user to home.aspx once they gets authenticated successfully...

 


/GuruBhai
0
guru_sarkar
1/26/2009 7:39:19 PM

 that would not work, since the login is present on every page (Master Control).

what I did is if the role type is user, then just redirect him/her to the same page they are on. It does the trick for now, but I hate the solution... It is funny that by default if no form tag is present in the web.config it does not redirect the users to a default login page.

0
LastManStanding
1/26/2009 7:54:47 PM

are you denying anonymous access to your site i.e.:

<authorization>

<deny users="?"/>

</authorization>


/GuruBhai
0
guru_sarkar
1/26/2009 7:58:35 PM

guru_sarkar:

are you denying anonymous access to your site i.e.:

<authorization>

<deny users="?"/>

</authorization>

 

Yes for the admin piece. the public section I handle the content based on loginview control.

  <location path="admin">
    <system.web>
      <authorization>
        <allow roles="super, administrator" />
        <deny users="*" />
      </authorization>
    </system.web>
  </location>

0
LastManStanding
1/26/2009 11:02:19 PM

other than explicitly redirecting .. the reasons why user are getting redirect to default page could be:

defaultUrl of forms tag is by default ....default.aspx....So you have to set it explicitly. If you remove forms tag there is no defaultUrl so you stay on the same page i.e. a postback and not redirect.

So you have to set the defaultUrl property to something else. :

http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.defaulturl.aspx

Other reason

default.aspx is the start page ... and you are denying anonymous access to default.aspx ..which is not the case with you.

 


/GuruBhai
0
guru_sarkar
1/26/2009 11:14:57 PM

 

guru_sarkar:

other than explicitly redirecting .. the reasons why user are getting redirect to default page could be:

defaultUrl of forms tag is by default ....default.aspx....So you have to set it explicitly. If you remove forms tag there is no defaultUrl so you stay on the same page i.e. a postback and not redirect.

So you have to set the defaultUrl property to something else. :

http://msdn.microsoft.com/en-us/library/system.web.security.formsauthentication.defaulturl.aspx

Other reason

default.aspx is the start page ... and you are denying anonymous access to default.aspx ..which is not the case with you.

 

yeah, looks like the the way the logic flows, is the moment form tag is present in web.config then basically all the defaults kick in. I did explicit redirect, unless they change the logic in the framework, i don't think there is any other way.

0
LastManStanding
1/27/2009 8:43:25 PM
Reply:

Similar Artilces:

Why Response.Write("<script>window.open("newWind.aspx','report','');</script>") not working?
I need to open a new web browser of url=newWind.aspx and tried the code below; Response.Write("<script>window.open('newWind.aspx','report','');</script>")However nothing happens, what can I do to make it work? Try RegisterClientScriptBlock("OpenWin","<script language=javascript>window.open('newWind.aspx','report','');</script>")I think that is the name of it...Also look at RegisterStartupScriptBlock (I think)MajorCats Thanks. But, it was same difference. Is there anything that blocks the new browser from showing up in the setting of IE or system?   &nbs...

What if I remove <form id="form1" runat="server"></form>
If I am creating an aspx page, which does not need to be a form, i.e. no input is taken from the user, do I need to encapsulate the whole page with in  <form1 runat="server">   What are the implications of removing the form? I realize there will be no viewstate, and again, I won't be able to accept user input, but will everything else work as expected? It seems to be so far, I've just not seen ANY examples where the form tag has been removed. Thanks, Darragh You need the server-side form tag if you are going to have server-side controls on the form.RyanRyan Olshan...

<FORM method="post"> to aspx page with <Iframe>
Hi Guys,I'm fighting here with something nasty. On my e-commerce site, I've a GridView that showes: Order number, Address and Tracking number.Being a customer of UPS, I've got this code from them, that ridirect the user in a UPS custom page to view the order shipping status of the InquiryNumber inputted : <FORM method="post" action = "http://wwwapps.ups.com/WebTracking/OnlineTool"><INPUT type="text" size=35 name="InquiryNumber"><INPUT type="hidden" name="TypeOfInquiryNumber" value="T"><...

can I delete <form id="form1" runat="server"> and </form>
Hi: Our website is written by using simple html code, one of the page has some virtual shopping cart code with <form> ....</form>, (for example here: http://www.centercoin.com/coin_supplies/coin_collecting_starter_set.htm ), if I have 10 products, I will have 10 of <from> ...</form> in this page, that is ok. Now, I am trying to redesign the website using asp.net2.0, I notice all the asp page will automatically create a <form id="form1" runat="server"> ...</form>, such as: <html xmlns="http://www.w3.org/19...

Can't use "defaultbutton" in <form></form> tag in login control page.
I have a login control and I tried to set the default button as the submit button within my form tag in the login page.But, I am getting the following error.Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. I already generated the machine key.Any clue! hi robin, Please try this fix if.. add the below given code into your web.config or the file that you are executing and see if your issue gets...

Template field and href?? <a href='<%# DataBinder.Eval(Container.DataItem,"urunnumarasi",Request.ApplicationPath+"/detayliurun.aspx?urunnumarasi={0}") %>'> ....how can i send categor, category1 with u
hi friends my code is below.. how can i send categor, category1 with urunnumarasi with below code?  catagory and category1 are other coulumname <a href='<%# DataBinder.Eval(Container.DataItem,"urunnumarasi",Request.ApplicationPath+"/detayliurun.aspx?urunnumarasi={0}") %>'> cheersMark as me if my question or my answer can be helpful for you :) Hi oguzkaygun, Try this: <a href='<%# Request.ApplicationPath+"/detayliurun.aspx?" + DataBinder.Eval(Container.DataItem, "category") + "=" + DataBinder.Ev...

"<table></table>" and "<frameset><frame></frame></frameset>" in perl/tk
Dear my friends... Anybody would be so kind telling me what is similar in perl/tk to arrange the location of a form written in perl/tk? I want a nice look for my perl/tk application. Somewhat like this below: 1. Name : <place to type-in> 2. Address : <place to type-in> 3. Telephone : <place to type-in> I have made the main menu of my application with "Menubutton". And I want if the user click on the menu that what the user see is only the aimed application displayed on the determined area (under the main menu) but the menu has no change in po...

<a href=http://1url.org/go/1sxwa>auto comparison insurance rate</a><a href=http://1url.org/go/1ecsa>auto insurance quote rate</a><a href=http://1url.org/go/1was>auto insurance quote</a><a href=http://
Name: tptvz Email: gafsoatpohuidotcom Product: Firefox Summary: <a href=http://1url.org/go/1sxwa>auto comparison insurance rate</a><a href=http://1url.org/go/1ecsa>auto insurance quote rate</a><a href=http://1url.org/go/1was>auto insurance quote</a><a href=http://1url.org/go/1esac>auto insurance quotes</a><a href=http://1url.org/go/1kgdfv>online auto insurance quote</a> Comments: <a href=http://1url.org/go/1sxwa>auto comparison insurance rate</a><a href=http://1url.org/go/1ecsa>auto insurance quote rate&...

Can I pass a parameter in here: Response.Write("<script language='Javascript'>window.open('ReportUmpireGrading.aspx')</script>")
HelloI am using this line of code to start a page for my report but I now need to pass  string parameters to that new page being popped-up. Response.Write("<script language='Javascript'>window.open('ReportUmpireGrading.aspx')</script>")Can I do it?ThanksI think, therefore I am Is this what you are after??? Response.Write("<script language='Javascript'>window.open('ReportUmpireGrading.aspx?q" & asdf & "&e=" & sdfg &"')</script>")EricPascarello.com | Twitter epascarello | LinkedIn Response.Write is evil. What A1ien51 has written is correct...

connectionstrings and web.config // login failed for user '<<domain>>\<<servername>>$'
It seems that the account mentioned <>\Server$ is the NTAUTHORITY\NETWORKSERVICE I read some posts on the net about .NET 1.1 that involved changing your machine.config.. not an option I like because then the webserver of my hosting company needs to do that to. Visual studio 2005 makes for the dataset a code behind file <>.designer.cs. I did change the connectionstring from my commands to a connectionstring with sql credentials. But it doesn't update everything. My logic was that when i remove the connectionstrings from the app.config or web.config they don't exist anymore so I ...

web.config <healthMonitoring> <bufferModes> <add ... regularFlushInterval="Infinite"> no longer legal?
Why does some documentation say that when adding a bufferModes item to one's health monitoring, that "Infinite" is a legitimate value for the regularFlushInterval attribute, but now the web.config schema apparently says it's not a legal value?  Did something change in what's permitted?  Did this once work but no longer does?  Or does it still work in spite of the warning message that says "the 'regularFlushInterval' attribute is invalid"?  I believe "Infinite" is a valid value.  See http://msdn.microsoft.com/en-us/l...

<sessionState timeout="x"/> vs <forms timeout="y"/>
How to configure web app: x=y x>y x<y ?...

help building this into a string: <div style="background-image: url('303.jpg'); background-repeat: no-repeat;">this is place holder<br />of this image</div>
I want to build this difinition into a javascriptp string for insertion like var str = '<div id="tempewoiew{1}" style="background-image: url("'"/BCW_Web/PhotoFeeders/GetNewImagePoolPhotoThumbNail.aspx?ImagePoolPhotoIndex={2}"'"); background-repeat: no-repeat;">this is place holder<br />of this image</div>';   element.innerHTML = str; but the part url('303.jpg'); screws me up...   its the quotation marks or the semi colon..??? i dont know how to express the quotation marks in this statement ...

Response.Write("<script>window.open('info.aspx')</script>"); causes font size to change on GridView_SelectedIndexChanged
Hey guys, Does anyone know why this is happening? If I redirect to a URL into a new window using the above code, it causes the font size to be gigantic after the postback. It happens only in IE though. Is there a known solution for that or another way to redirect into another window with the GridView_SelectedIndexChanged Event? TIA! Its because the text is displayed outside of the HTML decleration. If you check your HTML source code it will look like this:<script>window.open('info.aspx')</script><HTML>etc................. You may be better off have a literal con...

Web resources about - I've placed <forms loginUrl="home.aspx"></forms> in web.config and now all users that log in go to default.aspx - asp.net.security

Resources last updated: 12/15/2015 11:40:44 PM