<Login>

New to Version 4.0! The Login tag will log the specified user into the DNN website.


Syntax

<Login
    FirstNameField="string"
    LastNameField="string"
    Password="string"
    RememberMe="True|False"
    UserIdField="string"
    Username="string"
    UsernameField="string" />
 

Remarks

 

Back to top

Example

<AddForm>
  <Login Username='[[Uname]]' Password='[[Pword]]' UsernameField="UsrName" UserIdField="UsrId" />
  <Redirect Target="~/Home.aspx?uid=[[UsrId]]&un=[[UsrName]]" />
  
  <Label For="Uname" Text="Username:" />
  <TextBox Id="Uname" DataField="Uname" DataType="string" /> <br />

  <Label For="Pword" Text="Password:" />
  <Password Id="Pword" DataField="Pword" DataType="string" /> <br />

  <AddButton Text="Add" /> &nbsp;<CancelButton Text="Cancel" />
</AddForm>

In the example above note how we're using Field Tokens ([[Uname]] and [[Pword]]) to grab the data from the form controls. Additionally, we're telling the Login tag to add the user's Username and UserID to any tags "downstream". The field names that will be used are "UsrName" for the Username and "UsrId" for the UserID. There is one "downstream" action - the <Redirect> tag. It's using those fields in its Target property to feed the data into the URL. NOTE that in this specific case (and unlike most other XMod Pro forms) we can simply put the field tokens [[UsrName]] and [[UsrId]] directly into the target property without having to use the JOIN() function.

 

Back to top