Developer forum

Forum » Development » Problem with Simple login form

Problem with Simple login form

Dmitrij Jazel
Reply

Hi Guys,

I am trying to use yet the most simple ever Login form

I saw one of those forms in one of your screencast, and I used this form on other solutions, it always works.

But for some reason I runned into a problem now. And it looks like it is not working, not sure why.

form code:

<!--@If Defined(Global:Extranet.UserName)-->
  <div id="loggedin">
    Velkommen, <!--@DWextranet_AccessUserUserName-->! <a href="/admin/public/ExtranetLogoff.aspx?ID=1" class="logout">Log ud</a>
  </div>
<!--@EndIf(Global:Extranet.UserName)-->
<!--@If Not Defined(Global:Extranet.UserName)-->
  <div id="login">
    <form onSubmit="return checkform();" action="Default.aspx?ID=38" name="ExtUserForm" id="login-form" method="POST">
      <input type="text" id="username" name="username" placeholder="Brugernavn" value="" />
      <input type="password" id="password" name="password" placeholder="Brugernavn" value="" />
      <input type="submit" id="logind" name="submit" value="Log ind" />
    </form>
  </div>
<!--@EndIf(Global:Extranet.UserName)-->

 

After I click "loggin" it posts the form and nothing happens...

Wanted to ask if there can be any reason why this might not work?

Or what can I try to fix it?

 

//Dmitrij

 

Note: action="Default.aspx?ID=38" is the page that supposed to do the login. Make sure you do not redirect user to non-existing page.


Replies

 
Dmitrij Jazel
Reply

Does anyone has any clues what can cause such behavior?

What do I need to check in order for login to work?

Just for the record, in page > properties > advanced > permissions there is a placeholder for defining "login template". And this one is missing. I feel that they are probably somehow related. But why, how, or where to look for answers? :-/

Please help :-(

 

//Dmitrij

no_permissions.png
 
Nicolai Høeg Pedersen
Reply

Hi Dmitrij

 

I do not know what is wrong with your template.

 

The snippet Works, try that:

 

 

 

<!--@If Defined(Global:Extranet.UserName)-->
			<em>You are logged in as:</em><br />
			<strong>
				<!--@Global:Extranet.Name-->
			</strong>
			<a href="/Admin/Public/ExtranetLogoff.aspx?ID=<!--@DwPageID-->">Logout...</a>
			<!--@EndIf(Global:Extranet.UserName)-->
			<!--@If Not Defined(Global:Extranet.UserName)-->
			<strong>Login</strong>
			<form id="login" action="Default.aspx" method="post">
				<input type="hidden" name="ID" value="<!--@DwPageID-->" />
				<label for="username">
					Username</label>
				<input type="text" name="username" id="username" />
				<label for="password">
					Password</label>
				<input type="password" name="password" id="password" />
				<input type="submit" value="Login" />
			</form>
			<!--@EndIf(Global:Extranet.UserName)-->
 
Dmitrij Jazel
Reply

Hej Nicolai,

Thanks for the code snippet,

I just tried it and I got the same result as with one I was using. 

And as I can see it is almost the same snippet. 

 

As a result Global:Extranet.UserName is never defined.

is there any way I could I could find out why this particular instance does not authenticate?

 

//Dmitrij

 

 
Nicolai Høeg Pedersen
Reply

It works.

 

Check if it is the right username/password. Or post the link here.

 

Nicolai

 
Dmitrij Jazel
Reply

Hej Nicolai,

I tried your code on other solution, and yes I see it works. The problem is that it is still not working on the server that has that issue.

And I am more than sure that username and password are correct.

I would like to show you the website, but it is hosted locally, and accessible only through our network.

 

 
Nicolai Høeg Pedersen
Reply

OK.

Then I can not helpt you further I'm affraid. You have to debug your self!

 

Try see what fiddler says.

 

NP

 
Dmitrij Jazel
Reply

Hi again,

I will give it a shot :)

Thanks for so much...

 

You must be logged in to post in the forum