They are different objects, the textbox will eventually get streamed out
as
an INPUT anyway. I don't know about the performance differences, I'm
guessing minimal if any. Nothing to be concerned about in any case,
because
if there are any differences, it won't be anything a user would notice.
Thanks.
Just wonder if there is any performance difference when comparing using
HTML
controls and using Web Form controls. For example, <INPUT
type="text".../>
vs
<asp:TextBox.../>? Why?
:
This is actually a compile time message. Not a runtime error.
So, first off, any HTML tag you want to access in server side code
needs
to
have a runat="server" on it. You then need to declare a corresponding
variable. This would be automatically done for you if you had dragged
the
control onto the designer surfaces at design time.
Additionally, setting an INPUT control to a string value makes no
logical
sense. You would want to set its Value property, not the actual
object.
I recommend you do some some reading on the ASP.NET server side
control
model before going too much further down this path.
when I run it, I got error message:
C:\Inetpub\wwwroot\mes\Admin\NewUser.aspx.cs(53):
'mes.Admin.NewUser'
does
not contain a definition for 'firstName'
but in HTML view, I did have:
<TD><INPUT id="firstName" style="WIDTH: 204px; HEIGHT: 25px"
type="text"
size="28" name="fName"></TD>
:
What does 'it did not work' mean? That could mean one of any number
of
things, and if you want constructive help, you will have to not be
vague
in
your question. You need to tell us exactly how/when you are getting
your
data, what you expect to happen, what actually does happen, and the
exact
error message if any.
Hi, friends,
In Page_Load() events, I want to initialize this web page with
values I
retrieved from DB.
For example, for the element <INPUT type="text" id="firstName"
.../>, I
want
to make its value equal to "John".
So, in C#, I did:
this.firstName = dbrow["firstName"].ToString();
and, it did not work.
What should I do? Any sample code? Thanks.