0

I have this setting in my asp.net website web.config file:

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

but this cause my login page 'page_load' event fires twice! when i remove this config , page_load is fired once. how can i prevent this behaviour?

I read a captcha image from an external site and show that in my login page, when my page_load fires twice it reads the captcha image twice.

 if (!Page.IsPostBack)
 {
    ReadCaptcha();
 }

thanks.

  • If you use the Developer Tools in your browser, how many requests are being made to `login.aspx`? One or two? – mjwills Aug 13 '17 at 13:12
  • I Test it with an empty login page without any image or other resources. but again It cause page_load fires twice! – Nima Masghadi Aug 13 '17 at 13:12
  • @mjwills 2 times, http://localhost:7554/Login.aspx?ReturnUrl=%2f and http://localhost:7554/Login.aspx?ReturnUrl=%2f__browserLink%2frequestData%2f88ad473abb7d49f2b71e683588d016da%3fversion%3d2&version=2 – Nima Masghadi Aug 13 '17 at 13:15

1 Answers1

1

I solved the problem whit this appSetting in my web.config :

  <appSettings><add key="vs:EnableBrowserLink" value="false"></add></appSettings>

it disables browserlink that cause the second request for login.aspx. Thanks to @mjwills.