locked
Ugly textboxes RRS feed

  • Question

  • User-1793215261 posted

    Hello

    I have a page online here: http://www.dimadayoub.net/resetPwd.aspx which has two unsightly textboxes:

    The code for these boxes is:

    <asp:TextBox ID="txtNewPwd" runat="server"></asp:TextBox>
    
    <asp:TextBox ID="txtConfirmPwd" runat="server"></asp:TextBox>

    Do I need to show those textboxes at all on my resetPwd.aspx page if they are only referenced as follows in my resetPwd.aspx.vb file: 

     Protected Sub resetBtn_Click(sender As Object, e As System.EventArgs) Handles resetBtn.Click
    
            Try
    
                Using conn As OleDbConnection = New OleDbConnection(System.Configuration.ConfigurationManager.ConnectionStrings("students").ConnectionString)
    
                   Dim Sql As String = "UPDATE university SET uniqueCode='',[password]=@password WHERE uniqueCode=@uniqueCode AND (strEmail=@strEmail)"
    
                    Dim cmd As New OleDbCommand(Sql, conn)
    
                    conn.Open()
    
                    cmd.Parameters.AddWithValue("@uniqueCode", Convert.ToString(Request.QueryString("uniqueCode")))
                    cmd.Parameters.AddWithValue("@password", txtNewPwd.Text.Trim())
                    cmd.Parameters.AddWithValue("@strEmail", Convert.ToString(Request.QueryString("strEmail")))
    
                    cmd.ExecuteNonQuery()
    
                    lblStatus.Text = "Password updated"
    
                    lblStatus.Visible = True
    
                    txtNewPwd.Text = String.Empty
    
                    txtConfirmPwd.Text = String.Empty
    
                End Using
    
            Catch ex As Exception
    
                lblStatus.Text = "Error Occured : " & ex.Message.ToString()
    
                lblStatus.Visible = True
    
            Finally
    
                cmd.Dispose()
    
                conn.Close()
    
            End Try
    
        End Sub

    Many thanks!

    Sunday, November 20, 2016 3:25 PM

Answers

  • User177399542 posted

    You can hide your textboxes using:

    <asp:TextBox ID="txtNewPwd" runat="server" style="display:none"></asp:TextBox>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 21, 2016 4:31 AM

All replies

  • User177399542 posted

    You can hide your textboxes using:

    <asp:TextBox ID="txtNewPwd" runat="server" style="display:none"></asp:TextBox>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 21, 2016 4:31 AM
  • User-1793215261 posted

    Thank you anuj_koundal!

    Monday, November 21, 2016 5:36 AM