473,729 Members | 2,105 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

assign value to a text box

i have the code below:

for starters the value of txtempid = 1
after i go through this routine (i put a break point on the txtname.value
line), the value of txtEmpID is 2 (Just like it is suppose to be)
However, when i come into this function again, txtEmpID = 1 again
For some reason the txtEmpID.value isn't retaining its actual value of 2

any ideas?
Try

Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
txtEmpID.Value) (0)

With row

txtEmpID.Value = .Item("emp_id") .ToString

txtFName.Value = .Item("Fname"). ToString

txtLName.Value = .Item("LName"). ToString

End With

Catch err As Exception

lblError.Text = "No Previous records " & err.ToString()

End Try
Nov 18 '05 #1
12 2348
You didn't post a function; you posted a block of code. It would have helped
if you DID post the function, because the problem lies in how you
initialized "txtEmpID" and I strongly suspect that you initialized it in the
function definition. This would result in its being initialized every time
the function is called.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:#D******** *****@TK2MSFTNG P10.phx.gbl...
i have the code below:

for starters the value of txtempid = 1
after i go through this routine (i put a break point on the txtname.value
line), the value of txtEmpID is 2 (Just like it is suppose to be)
However, when i come into this function again, txtEmpID = 1 again
For some reason the txtEmpID.value isn't retaining its actual value of 2

any ideas?
Try

Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
txtEmpID.Value) (0)

With row

txtEmpID.Value = .Item("emp_id") .ToString

txtFName.Value = .Item("Fname"). ToString

txtLName.Value = .Item("LName"). ToString

End With

Catch err As Exception

lblError.Text = "No Previous records " & err.ToString()

End Try

Nov 18 '05 #2
Here is the function..

Private Sub btnNext_ServerC lick(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnPrev.ServerC lick
Try

Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
txtEmpID.Value) (0)

With row

txtEmpID.Value = .Item("emp_id") .ToString

txtFName.Value = .Item("Fname"). ToString

txtLName.Value = .Item("LName"). ToString

End With

Catch err As Exception

lblError.Text = "No Nextrecords " & err.ToString()

End Try

End Sub

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:OC******** *****@TK2MSFTNG P12.phx.gbl...
You didn't post a function; you posted a block of code. It would have helped if you DID post the function, because the problem lies in how you
initialized "txtEmpID" and I strongly suspect that you initialized it in the function definition. This would result in its being initialized every time
the function is called.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:#D******** *****@TK2MSFTNG P10.phx.gbl...
i have the code below:

for starters the value of txtempid = 1
after i go through this routine (i put a break point on the txtname.value line), the value of txtEmpID is 2 (Just like it is suppose to be)
However, when i come into this function again, txtEmpID = 1 again
For some reason the txtEmpID.value isn't retaining its actual value of 2

any ideas?
Try

Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
txtEmpID.Value) (0)

With row

txtEmpID.Value = .Item("emp_id") .ToString

txtFName.Value = .Item("Fname"). ToString

txtLName.Value = .Item("LName"). ToString

End With

Catch err As Exception

lblError.Text = "No Previous records " & err.ToString()

End Try


Nov 18 '05 #3
Okay, it looks like when you say "when I come into this function again"
you're talking about a PostBack? If so, is your TextBox control's
EnableViewState property set to True?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
Here is the function..

Private Sub btnNext_ServerC lick(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnPrev.ServerC lick
Try

Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
txtEmpID.Value) (0)

With row

txtEmpID.Value = .Item("emp_id") .ToString

txtFName.Value = .Item("Fname"). ToString

txtLName.Value = .Item("LName"). ToString

End With

Catch err As Exception

lblError.Text = "No Nextrecords " & err.ToString()

End Try

End Sub

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:OC******** *****@TK2MSFTNG P12.phx.gbl...
You didn't post a function; you posted a block of code. It would have

helped
if you DID post the function, because the problem lies in how you
initialized "txtEmpID" and I strongly suspect that you initialized it in

the
function definition. This would result in its being initialized every time
the function is called.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:#D******** *****@TK2MSFTNG P10.phx.gbl...
i have the code below:

for starters the value of txtempid = 1
after i go through this routine (i put a break point on the

txtname.value line), the value of txtEmpID is 2 (Just like it is suppose to be)
However, when i come into this function again, txtEmpID = 1 again
For some reason the txtEmpID.value isn't retaining its actual value of 2
any ideas?
Try

Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
txtEmpID.Value) (0)

With row

txtEmpID.Value = .Item("emp_id") .ToString

txtFName.Value = .Item("Fname"). ToString

txtLName.Value = .Item("LName"). ToString

End With

Catch err As Exception

lblError.Text = "No Previous records " & err.ToString()

End Try



Nov 18 '05 #4
I should have mentioned this earlier, I am using a HTML text box, not a web
form text box. when i use a web form text box, everything works fine, but i
want to try a HTML text box.
the html text box doesn't have the enableviewstate property.

thanks

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Okay, it looks like when you say "when I come into this function again"
you're talking about a PostBack? If so, is your TextBox control's
EnableViewState property set to True?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
Here is the function..

Private Sub btnNext_ServerC lick(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnPrev.ServerC lick
Try

Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
txtEmpID.Value) (0)

With row

txtEmpID.Value = .Item("emp_id") .ToString

txtFName.Value = .Item("Fname"). ToString

txtLName.Value = .Item("LName"). ToString

End With

Catch err As Exception

lblError.Text = "No Nextrecords " & err.ToString()

End Try

End Sub

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:OC******** *****@TK2MSFTNG P12.phx.gbl...
You didn't post a function; you posted a block of code. It would have helped
if you DID post the function, because the problem lies in how you
initialized "txtEmpID" and I strongly suspect that you initialized it
in the
function definition. This would result in its being initialized every

time the function is called.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:#D******** *****@TK2MSFTNG P10.phx.gbl...
> i have the code below:
>
> for starters the value of txtempid = 1
> after i go through this routine (i put a break point on the

txtname.value
> line), the value of txtEmpID is 2 (Just like it is suppose to be)
> However, when i come into this function again, txtEmpID = 1 again
> For some reason the txtEmpID.value isn't retaining its actual value
of 2 >
> any ideas?
> Try
>
> Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
> txtEmpID.Value) (0)
>
> With row
>
> txtEmpID.Value = .Item("emp_id") .ToString
>
> txtFName.Value = .Item("Fname"). ToString
>
> txtLName.Value = .Item("LName"). ToString
>
> End With
>
> Catch err As Exception
>
> lblError.Text = "No Previous records " & err.ToString()
>
> End Try
>
>



Nov 18 '05 #5
also, to text this more simply, I just put a html text box and a html button
on a form and put the following code behind it..when i first enter a "1" in
the text box and hit the button, the value is 1. then if i put a 2 in the
box and hit the button, the value remains 1

Private Sub Button1_ServerC lick(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.ServerC lick

Dim a As Integer = txtEmpID.Value

end Sub

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Okay, it looks like when you say "when I come into this function again"
you're talking about a PostBack? If so, is your TextBox control's
EnableViewState property set to True?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
Here is the function..

Private Sub btnNext_ServerC lick(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnPrev.ServerC lick
Try

Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
txtEmpID.Value) (0)

With row

txtEmpID.Value = .Item("emp_id") .ToString

txtFName.Value = .Item("Fname"). ToString

txtLName.Value = .Item("LName"). ToString

End With

Catch err As Exception

lblError.Text = "No Nextrecords " & err.ToString()

End Try

End Sub

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:OC******** *****@TK2MSFTNG P12.phx.gbl...
You didn't post a function; you posted a block of code. It would have helped
if you DID post the function, because the problem lies in how you
initialized "txtEmpID" and I strongly suspect that you initialized it
in the
function definition. This would result in its being initialized every

time the function is called.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:#D******** *****@TK2MSFTNG P10.phx.gbl...
> i have the code below:
>
> for starters the value of txtempid = 1
> after i go through this routine (i put a break point on the

txtname.value
> line), the value of txtEmpID is 2 (Just like it is suppose to be)
> However, when i come into this function again, txtEmpID = 1 again
> For some reason the txtEmpID.value isn't retaining its actual value
of 2 >
> any ideas?
> Try
>
> Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
> txtEmpID.Value) (0)
>
> With row
>
> txtEmpID.Value = .Item("emp_id") .ToString
>
> txtFName.Value = .Item("Fname"). ToString
>
> txtLName.Value = .Item("LName"). ToString
>
> End With
>
> Catch err As Exception
>
> lblError.Text = "No Previous records " & err.ToString()
>
> End Try
>
>



Nov 18 '05 #6
Well, there's your problem. You need a Control that Maintains State across
PostBacks.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:uu******** ******@TK2MSFTN GP10.phx.gbl...
I should have mentioned this earlier, I am using a HTML text box, not a web form text box. when i use a web form text box, everything works fine, but i want to try a HTML text box.
the html text box doesn't have the enableviewstate property.

thanks

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Okay, it looks like when you say "when I come into this function again"
you're talking about a PostBack? If so, is your TextBox control's
EnableViewState property set to True?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
Here is the function..

Private Sub btnNext_ServerC lick(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles btnPrev.ServerC lick
Try

Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
txtEmpID.Value) (0)

With row

txtEmpID.Value = .Item("emp_id") .ToString

txtFName.Value = .Item("Fname"). ToString

txtLName.Value = .Item("LName"). ToString

End With

Catch err As Exception

lblError.Text = "No Nextrecords " & err.ToString()

End Try

End Sub

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:OC******** *****@TK2MSFTNG P12.phx.gbl...
> You didn't post a function; you posted a block of code. It would have helped
> if you DID post the function, because the problem lies in how you
> initialized "txtEmpID" and I strongly suspect that you initialized
it
in the
> function definition. This would result in its being initialized
every time
> the function is called.
>
> --
> HTH,
> Kevin Spencer
> .Net Developer
> Microsoft MVP
> Big things are made up
> of lots of little things.
>
> "Mark Kurten" <ma*********@ac ordia.com> wrote in message
> news:#D******** *****@TK2MSFTNG P10.phx.gbl...
> > i have the code below:
> >
> > for starters the value of txtempid = 1
> > after i go through this routine (i put a break point on the
txtname.value
> > line), the value of txtEmpID is 2 (Just like it is suppose to be)
> > However, when i come into this function again, txtEmpID = 1 again
> > For some reason the txtEmpID.value isn't retaining its actual
value of
2
> >
> > any ideas?
> > Try
> >
> > Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
> > txtEmpID.Value) (0)
> >
> > With row
> >
> > txtEmpID.Value = .Item("emp_id") .ToString
> >
> > txtFName.Value = .Item("Fname"). ToString
> >
> > txtLName.Value = .Item("LName"). ToString
> >
> > End With
> >
> > Catch err As Exception
> >
> > lblError.Text = "No Previous records " & err.ToString()
> >
> > End Try
> >
> >
>
>



Nov 18 '05 #7
would this be a html control or a web control?
I'm assuming there is a control that does this....
thanks.
"Kevin Spencer" <ke***@takempis .com> wrote in message
news:Od******** ********@TK2MSF TNGP10.phx.gbl. ..
Well, there's your problem. You need a Control that Maintains State across
PostBacks.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:uu******** ******@TK2MSFTN GP10.phx.gbl...
I should have mentioned this earlier, I am using a HTML text box, not a web
form text box. when i use a web form text box, everything works fine, but i
want to try a HTML text box.
the html text box doesn't have the enableviewstate property.

thanks

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Okay, it looks like when you say "when I come into this function again" you're talking about a PostBack? If so, is your TextBox control's
EnableViewState property set to True?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
> Here is the function..
>
> Private Sub btnNext_ServerC lick(ByVal sender As System.Object, ByVal e
As
> System.EventArg s) Handles btnPrev.ServerC lick
>
>
> Try
>
> Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
> txtEmpID.Value) (0)
>
> With row
>
> txtEmpID.Value = .Item("emp_id") .ToString
>
> txtFName.Value = .Item("Fname"). ToString
>
> txtLName.Value = .Item("LName"). ToString
>
> End With
>
> Catch err As Exception
>
> lblError.Text = "No Nextrecords " & err.ToString()
>
> End Try
>
> End Sub
>
> "Kevin Spencer" <ke***@takempis .com> wrote in message
> news:OC******** *****@TK2MSFTNG P12.phx.gbl...
> > You didn't post a function; you posted a block of code. It would

have > helped
> > if you DID post the function, because the problem lies in how you
> > initialized "txtEmpID" and I strongly suspect that you initialized it
in
> the
> > function definition. This would result in its being initialized

every time
> > the function is called.
> >
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "Mark Kurten" <ma*********@ac ordia.com> wrote in message
> > news:#D******** *****@TK2MSFTNG P10.phx.gbl...
> > > i have the code below:
> > >
> > > for starters the value of txtempid = 1
> > > after i go through this routine (i put a break point on the
> txtname.value
> > > line), the value of txtEmpID is 2 (Just like it is suppose to

be) > > > However, when i come into this function again, txtEmpID = 1 again > > > For some reason the txtEmpID.value isn't retaining its actual

value
of
2
> > >
> > > any ideas?
> > > Try
> > >
> > > Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
> > > txtEmpID.Value) (0)
> > >
> > > With row
> > >
> > > txtEmpID.Value = .Item("emp_id") .ToString
> > >
> > > txtFName.Value = .Item("Fname"). ToString
> > >
> > > txtLName.Value = .Item("LName"). ToString
> > >
> > > End With
> > >
> > > Catch err As Exception
> > >
> > > lblError.Text = "No Previous records " & err.ToString()
> > >
> > > End Try
> > >
> > >
> >
> >
>
>



Nov 18 '05 #8
Or do I use a session state object?

thanks.
"Kevin Spencer" <ke***@takempis .com> wrote in message
news:Od******** ********@TK2MSF TNGP10.phx.gbl. ..
Well, there's your problem. You need a Control that Maintains State across
PostBacks.

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:uu******** ******@TK2MSFTN GP10.phx.gbl...
I should have mentioned this earlier, I am using a HTML text box, not a web
form text box. when i use a web form text box, everything works fine, but i
want to try a HTML text box.
the html text box doesn't have the enableviewstate property.

thanks

"Kevin Spencer" <ke***@takempis .com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Okay, it looks like when you say "when I come into this function again" you're talking about a PostBack? If so, is your TextBox control's
EnableViewState property set to True?

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Mark Kurten" <ma*********@ac ordia.com> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
> Here is the function..
>
> Private Sub btnNext_ServerC lick(ByVal sender As System.Object, ByVal e
As
> System.EventArg s) Handles btnPrev.ServerC lick
>
>
> Try
>
> Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
> txtEmpID.Value) (0)
>
> With row
>
> txtEmpID.Value = .Item("emp_id") .ToString
>
> txtFName.Value = .Item("Fname"). ToString
>
> txtLName.Value = .Item("LName"). ToString
>
> End With
>
> Catch err As Exception
>
> lblError.Text = "No Nextrecords " & err.ToString()
>
> End Try
>
> End Sub
>
> "Kevin Spencer" <ke***@takempis .com> wrote in message
> news:OC******** *****@TK2MSFTNG P12.phx.gbl...
> > You didn't post a function; you posted a block of code. It would

have > helped
> > if you DID post the function, because the problem lies in how you
> > initialized "txtEmpID" and I strongly suspect that you initialized it
in
> the
> > function definition. This would result in its being initialized

every time
> > the function is called.
> >
> > --
> > HTH,
> > Kevin Spencer
> > .Net Developer
> > Microsoft MVP
> > Big things are made up
> > of lots of little things.
> >
> > "Mark Kurten" <ma*********@ac ordia.com> wrote in message
> > news:#D******** *****@TK2MSFTNG P10.phx.gbl...
> > > i have the code below:
> > >
> > > for starters the value of txtempid = 1
> > > after i go through this routine (i put a break point on the
> txtname.value
> > > line), the value of txtEmpID is 2 (Just like it is suppose to

be) > > > However, when i come into this function again, txtEmpID = 1 again > > > For some reason the txtEmpID.value isn't retaining its actual

value
of
2
> > >
> > > any ideas?
> > > Try
> > >
> > > Dim row As DataRow = ds.Tables("Test Table").Select( "emp_id > " &
> > > txtEmpID.Value) (0)
> > >
> > > With row
> > >
> > > txtEmpID.Value = .Item("emp_id") .ToString
> > >
> > > txtFName.Value = .Item("Fname"). ToString
> > >
> > > txtLName.Value = .Item("LName"). ToString
> > >
> > > End With
> > >
> > > Catch err As Exception
> > >
> > > lblError.Text = "No Previous records " & err.ToString()
> > >
> > > End Try
> > >
> > >
> >
> >
>
>



Nov 18 '05 #9
Hi Mark,
Thanks for posting in the community!
From your description, you used some HtmlInputText controls(set ast
runat=server) on an ASP.NET web page. However, you found that when you
posted back the page, the values in the HtmlInputText Control can't remain,
will return back to the original value, yes?
If there is anything I misunderstood, please feel free to let me know.

As for this problem, I'd like to confirm some further things on it:
1.You mentioned that when you input a value "2" in the html textbox and
post back the page, after that the value returned to "1", yes? Are you sure
there is no other code in codebehind will modify the textbox's value?

2.As you mentioned, you tested use the numeric value such as "1","2". Have
you tried using string value. For example, put a string like "Hello World"
and post back to see whether this remains?

3.I still feel this problem a bit strang, would you please try creating
another new project and do the same test in it? Also, do be sure that you
have'nt disable the ViewState of the page at PageLevel(@Page directive) or
Application Level(web.confi g) or ..

And here is a example page I used to test, maybe you can also try testing
on this page to see whether the problem remains:

-----------------------------------aspx
pape--------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>TestValu e</title>
<meta name="GENERATOR " content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<table width="500" align="center">
<tr>
<td><INPUT id="txtHtml" type="text" name="txtHtml" runat="server"> </td>
</tr>
<tr>
<td><INPUT id="btnHtml" type="button" value="Html Button"
name="btnHtml" runat="server">
<asp:Button id="Button1" runat="server" Text="ASP.NET
Button"></asp:Button></td>
</tr>
</table>
</form>
</body>
</HTML>

-----------------------------code behind page class-------------------------
Public Class TestValue
Inherits System.Web.UI.P age

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()

End Sub
Protected WithEvents Button1 As System.Web.UI.W ebControls.Butt on
Protected WithEvents txtHtml As System.Web.UI.H tmlControls.Htm lInputText
Protected WithEvents btnHtml As
System.Web.UI.H tmlControls.Htm lInputButton

'NOTE: The following placeholder declaration is required by the Web
Form Designer.
'Do not delete or move it.
Private designerPlaceho lderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeCompo nent()
End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub btnHtml_ServerC lick(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnHtml.ServerC lick
Response.Write( "<br>txtHtm l's value is " & txtHtml.Value)
End Sub

Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Response.Write( "<br>txtHtm l's value is " & txtHtml.Value)
End Sub
End Class
-----------------------------------------------------------

Please try out the preceding suggestions. If you feel any thing unclear or
need any help, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
4333
by: Rim | last post by:
Hi, I have been thinking about how to overload the assign operation '='. In many cases, I wanted to provide users of my packages a natural interface to the extended built-in types I created for them, but the assign operator is always forcing them to "type cast" or coerce the result when they do a simple assign for the purpose of setting the value of a variable. Borrowing an example from this newgroup, the second assignment below ereases...
1
1811
by: google | last post by:
It would seem that when I assign an HTML entity to a form text input using "inline" javascript that it will display properly. But when trying to set it via a function call, the entity text shows in the field instead of the symbol it represents. The following example produces these results on Opera 8.5 and IE 6.0 I am expecting the same results whichever way I set the contents of "myText". Why, when choosing "function" does "&copy"...
2
2297
by: Megan | last post by:
Hi everybody- I have 2 tables, Hearings and Rulings. Both have primary keys called, CaseID, that are autonumbers. I don't want both tables to have the same autonumber. For example, if Hearings has 55, then I want Rulings to have a number greater than 55. Two or more Hearings may be entered before a Ruling is entered. For example, Hearings with CaseIDs= 55, 56, and 57 may be entered before a Ruling or vice versa. There is no definite...
2
15724
by: dskillingstad | last post by:
I'm trying to assign a custom value to a textbox. Here's what I have. I've created a module and "default value" code for a textbox which generates a custom auto-number (yyyy-0000) when a New Record button is clicked. The code checks the table for the highest value and then assigns 1 and inserts the value. I have a second text box which needs the same type of custom auto-number which has to be generated from a second command button. ...
8
7413
by: Sergei | last post by:
Hi, I am displaying modal dialog and passing values from the main form to the modal dialog and back. It works fine but if I used the following syntax on Page_Load(just for testing) in VB to assign value form the object to text Box it gives error 'Object required' Dim strResponse As String strResponse = strResponse & "<script language=""JavaScript"">" & vbCrLf strResponse = strResponse & "var aForm; " & vbCrLf
15
26926
by: Swetha | last post by:
Hello I have a DropDownList that I am populating using the following SqlDataSource: <asp:DropDownList ID="parentIDDropDownList" runat="server" DataSourceID="SqlDataSource3" DataTextField="name" DataValueField="ID"></asp:DropDownList><asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
6
2276
by: david | last post by:
I try to use "for" loop to retrieve and assign values in web form. The code is in the following. But it can not be compiled. What I want to do is: txtQ1.Text = ds.Tables("mmsSpecRecord").Rows(0)("Q1") txtQ2.Text = ds.Tables("mmsSpecRecord").Rows(0)("Q2") ..... txtQ10.Text = ds.Tables("mmsSpecRecord").Rows(0)("Q10") ------code ------- Dim field As String = "Q"
2
6100
by: rachit.goyal | last post by:
Hi All, I am using .net first time.In my windows form VC7 application, on a click of button, I am assigning text of TextBox to STL string varibale. Using this code- private: System::Void FindValuesButton_Click(System::Object * sender, System::EventArgs * e) { string fileLoc ; fileLoc= CD_location->Text->ToString();
1
7495
by: vega80 | last post by:
Hi. I have a problem with assigning an onkeypress-function to dynamically created input-boxes.I want to put the content of an input-field into a tag-list when the user hits enter. This works fine the first time (when the input-field is created in a non-dynamical way). The next input-field is created dynamically by a function that is called when the user hits enter (the previously generated input-field will be hidden). Then I'm trying...
5
6067
by: lianping | last post by:
Hi, I have a problem to assign a value into text box, below will be my script. Before view my script, let me hv quick explain on what is my problem: I would like to assign Java script value into VB text box, but i fail to do so. I can pass value with using: <form id="form1" runat="server">. however I' not able to do so, as i already use runat="server" at my MasterPage. Is that any others way i can assign value into the TextBox. Error...
0
8927
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9289
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9210
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8159
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6026
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4534
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4798
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2694
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.