Home Trying to convert an asp.net login page in Asp.net mvc with react js
Reply: 0

Trying to convert an asp.net login page in Asp.net mvc with react js

user2843
1#
user2843 Published in August 15, 2018, 11:16 am

Iam very new to react js and i am trying to convert an asp.net login page in Asp.net mvc with react js. Login.aspx

<div class="content">

                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="material-icons">account_circle</i>
                                        </span>
                                      <asp:TextBox ID="txtUserName" class="form-control" placeholder="Personal Number..."  runat="server" ></asp:TextBox>

                                    </div>

                                    <div class="input-group">
                                        <span class="input-group-addon">
                                            <i class="material-icons">lock_outline</i>
                                        </span>
                                        <asp:TextBox ID="txtPswd" class="form-control" placeholder="Password..." runat ="server" TextMode ="Password"  ></asp:TextBox>
                                    </div>

                                    <div class="input-group">
                                        <asp:Label ID="lblError"  runat ="server" Visible="false" ></asp:Label>
                                    </div>
                                </div>
<div class="footer text-center">
                                       <asp:Button class="btn btn-primary" ID="btn_Login" runat="server" Text="Login" OnClick="btn_Login_Click"></asp:Button>
                                    <a href="Home.aspx" class="btn btn-primary">Back</a>
                                </div>  

Login.aspx.cs

protected void btn_Login_Click(object sender, EventArgs e)
    {
        Service1 objAd = new Service1();
        dynamic newResult = string.Empty;

        try
        {
            newResult = objAd.IsAuthenticatedWithMessage("mbs", txtUserName.Text.ToString(), txtPswd.Text.ToString());
            if (newResult.Equals("Authenticated"))
            {
                createSessionForUser(txtUserName.Text.ToString());
                lblError.Visible = false;
            }
            else
            {
                lblError.Visible = true;
                lblError.Text = "Invalid Username and Password..";
            }
        }
        catch (Exception ex)
        {
            Response.Redirect("ErrorPage.aspx");
        }
    }

How to convert this structure in react js and asp.net mvc any idea would be appreciated.I had completed the setup for react js with asp.net mvc in visual studio.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.294651 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO