Drop Down Box and other stuff in ASP.NET with VB.NET (VS 2008)

Posted by typoknig on Stack Overflow See other posts from Stack Overflow or by typoknig
Published on 2010-04-13T21:08:34Z Indexed on 2010/04/13 21:33 UTC
Read the original article Hit count: 399

Hi all, I am trying to polish up a program a program that I have converted from a Windows Form in to an ASP.NET Web Application. I have several questions:

1.) I have a drop down box where users can select their variables, but users can also enter their variables manually into various text fields. What I want is for the drop down box to show a string like "Choose Variables" when ever the user enters their variables manually. I want this to happen without having to reload the page.

2.) In the Windows Form version of this application I had a RichTextBox that populated with data (line by line) after a calculation was made. I used "AppendText" in my Windows Form, but that is not available in ASP.NET, and neither is the RichTextBox. I am open to suggestions here, I tried to use just a text box but that isn't working right.

3.) In my Windows Form application I was using "KeyPress" events to prevent incorrect characters from being entered into the text fields. My code for these events looked similar to this:

Private Sub TextBox_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox.KeyPress

        If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back AndAlso e.KeyChar <> "." Then
            e.Handled = True
        End If

End Sub

How can I make this work again... also without reloading the page.

4.) This is not a major issue, but I would like all of the text to be selected when the cursor enters a field. In my Windows Form application I used "SelectAll", but again, that is not available in ASP.NET

Thanks in advanced.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about vb.net