Click here to Skip to main content
15,168,695 members
Home / Discussions / C#
   

C#

 
GeneralRe: thread safety and performance Pin
Super Lloyd2-Dec-21 18:59
MemberSuper Lloyd2-Dec-21 18:59 
AnswerRe: thread safety and performance Pin
trønderen3-Dec-21 3:36
Membertrønderen3-Dec-21 3:36 
AnswerRe: thread safety and performance Pin
trønderen3-Dec-21 4:31
Membertrønderen3-Dec-21 4:31 
QuestionUpdate/refresh Combobox in Form1 after doing an add from Form 2 Pin
Richard A Knox2-Dec-21 6:19
MemberRichard A Knox2-Dec-21 6:19 
AnswerRe: Update/refresh Combobox in Form1 after doing an add from Form 2 Pin
BillWoodruff2-Dec-21 6:58
mveBillWoodruff2-Dec-21 6:58 
GeneralRe: Update/refresh Combobox in Form1 after doing an add from Form 2 Pin
Richard A Knox4-Dec-21 7:08
MemberRichard A Knox4-Dec-21 7:08 
GeneralRe: Update/refresh Combobox in Form1 after doing an add from Form 2 Pin
Gerry Schmitz5-Dec-21 9:04
mveGerry Schmitz5-Dec-21 9:04 
QuestionReading username Pin
Luis M. Rojas1-Dec-21 5:45
MemberLuis M. Rojas1-Dec-21 5:45 
Hello everybody,
I have to modify this code (the programmer who did it is not longer with us)
The problem is:

If you type the userid and password and click LOGIN: the program take the userid and password
but if you FORGOT your password, and click: Forgot password(Olvide contrasena), the programa check if you did not type the userid and show you a warning, the problem is that if you type the userid, and click Forgot the password, the userid it is not reads on the program. Any help?


The .chtml
  <div class="box box-primary login-box ewLoginBox">
  <div class="login-box-body">
  <p class="login-box-msg">@Html.Raw(Language.Phrase("Login"))</p>
  <div class="form-group">
    <div>
      <input type="text" name="username" id="username" class="form-control ewControl" 
      value="@_login.Username" placeholder="@Language.Phrase("Username")" autocomplete="username">
    </div>
  </div>
  <div class="form-group">
  	<div><input type="password" name="password" id="password" class="form-control ewControl" 
    placeholder="@Language.Phrase("Password")" autocomplete="current-password"></div>
  </div>
  <div class="checkbox">
	<label for="rememberme"><input type="checkbox" name="type" id="rememberme" value="a" 
       @Html.Raw((_login.LoginType == "a") ? " checked" : "")>@Html.Raw(Language.Phrase("RememberMe")) 
   </label>
 </div>
 <button class="btn btn-primary btn-block ewButton" name="btnsubmit" id="btnsubmit" 
    type="submit">@Html.Raw(Language.Phrase("Login"))
 </button>
 @if (Config.Authentications.Count(kvp => kvp.Value.Enabled) > 0)
 {
	<div class="social-auth-links text-center">
	   <p>@Html.Raw(Language.Phrase("LoginOr"))</p>
 	   @foreach (var kvp in Config.Authentications.Where(kvp => kvp.Value.Enabled))
	   {
  	     <a href="ExternalLogin?provider=@kvp.Key" class="btn btn-block btn-social btn-flat btn- 
         @kvp.Key.ToLower()">class="fa fa-@kvp.Key.ToLower()">@Html.Raw(Language.Phrase("Login" 
         + kvp.Key))</a>
	   }
	</div>
}
		
 <a href= 'login?expire="@_login.Username"'  class="btn btn-ic btn-link pkg-photo">Olvide mi clave</a>
</div>
</div>


The .cs is:
public IActionResult Page_Main() {
Username = ""; // Initialize
string password = "";
string lastUrl = Security.LastUrl; // Get last URL
if (Empty(lastUrl))
lastUrl = "Index";
// Login
if (IsLoggingIn()) { // After changing password
{
Username = Session.GetString(Config.SessionUserProfileUserName);
password = Session.GetString(Config.SessionUserProfilePassword);
} else { // Normal login
if (!Security.IsLoggedIn)
Security.AutoLogin();
Security.LoadUserLevel(); // Load user level
bool encrypted = false;
if (!Empty(Post("username"))) {
// Login by form post
Username = RemoveXss(Post("username"));

//Here the error, we sent 1, which it is passed, but the username is lost even you type, so the if (!Empty(Post(Username))) it is never executed
if (Get<bool>("expire"))
{
if (!Empty(Post(Username)))
{
AnswerRe: Reading username Pin
lmoelleb3-Dec-21 19:36
Memberlmoelleb3-Dec-21 19:36 
QuestionHow can I make the timer stay active after the program is closed? Pin
Duke Jason30-Nov-21 20:34
MemberDuke Jason30-Nov-21 20:34 
AnswerRe: How can I make the timer stay active after the program is closed? Pin
OriginalGriff30-Nov-21 21:09
mveOriginalGriff30-Nov-21 21:09 
AnswerRe: How can I make the timer stay active after the program is closed? Pin
Pete O'Hanlon30-Nov-21 22:24
mvaPete O'Hanlon30-Nov-21 22:24 
AnswerRe: How can I make the timer stay active after the program is closed? Pin
Dave Kreskowiak1-Dec-21 2:20
mveDave Kreskowiak1-Dec-21 2:20 
AnswerRe: How can I make the timer stay active after the program is closed? Pin
Gerry Schmitz1-Dec-21 19:09
mveGerry Schmitz1-Dec-21 19:09 
QuestionCode cast InvalidCastException when it "Shouldn't" Pin
Evilfish200029-Nov-21 20:28
MemberEvilfish200029-Nov-21 20:28 
AnswerRe: Code cast InvalidCastException when it "Shouldn't" Pin
OriginalGriff29-Nov-21 22:24
mveOriginalGriff29-Nov-21 22:24 
GeneralRe: Code cast InvalidCastException when it "Shouldn't" Pin
Evilfish200030-Nov-21 3:24
MemberEvilfish200030-Nov-21 3:24 
GeneralRe: Code cast InvalidCastException when it "Shouldn't" Pin
OriginalGriff30-Nov-21 3:50
mveOriginalGriff30-Nov-21 3:50 
GeneralRe: Code cast InvalidCastException when it "Shouldn't" Pin
Evilfish200030-Nov-21 23:05
MemberEvilfish200030-Nov-21 23:05 
GeneralRe: Code cast InvalidCastException when it "Shouldn't" Pin
OriginalGriff30-Nov-21 23:19
mveOriginalGriff30-Nov-21 23:19 
GeneralRe: Code cast InvalidCastException when it "Shouldn't" Pin
Eddy Vluggen30-Nov-21 9:02
professionalEddy Vluggen30-Nov-21 9:02 
AnswerRe: Code cast InvalidCastException when it "Shouldn't" Pin
#realJSOP30-Nov-21 0:25
mva#realJSOP30-Nov-21 0:25 
Questionwhile run the code got no such element found exception seleniumc# Pin
Member 1407570327-Nov-21 21:01
MemberMember 1407570327-Nov-21 21:01 
AnswerRe: while run the code got no such element found exception seleniumc# Pin
OriginalGriff27-Nov-21 21:17
mveOriginalGriff27-Nov-21 21:17 
QuestionList-box item of PropertyGrid in C# could showing only once Pin
wuxianzhong26-Nov-21 3:40
Memberwuxianzhong26-Nov-21 3:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.