Runat Server to display MSG and Submit to DB?

Senf

New Member
Is it possible to mix the runat server code for asp:textbox so that it both displays a message of what was submitted and submits it to a table? <BR><BR>I keep getting an error that the textbox is not a string, and it won't accept requet.form("textbox")<BR><BR>Of course this code doesn' work, but it's along the lines of what I have been attempting:<BR><BR>Public Class Welcome<BR> Inherits Page<BR><BR> <BR> Public Name As Textbox<BR> Public Welcome As Label<BR> Public myHtmlTable As HtmlTable<BR> Dim mycommand As SqlCommand<BR> Dim myConnection = New SqlConnection( "server=server;uid=sa;pwd=id;database=db" )<BR> Public Sub Page_Load(Sender As Object, E As EventArgs)<BR> If Not Page.IsPostBack Then<BR> myHtmlTable.Visible = True<BR> End If<BR> End Sub<BR><BR> Public Sub Submit_OnClick(Sender As Object, E As EventArgs)<BR> myHtmlTable.Visible = False<BR> Welcome.Text = "Welcome, " & _<BR> Name.Text & "!"<BR> <BR> End Sub<BR> <BR> myCommand = New SQLCommand( "Insert sqladd ( Name ) Values ( "name.text" )", myConnection )<BR><BR> End Sub<BR><BR>End Class
 
Back
Top