Showing posts with label empty. Show all posts
Showing posts with label empty. Show all posts

Wednesday, March 28, 2012

Text field is empty

I'm trying to insert a record on an sql server database table that has
among others a text type field. The insert happens without errors and
all the fields show the correct information except for the text field
when the number of characters is larger than 900. In this case the text
field appears empty. If the text is less or equal to 900 characters
they are inserted with no problem.

In this case have a stored procedure with several input variables
including the text one and a asp.net page with a command that is filled
with the several parameters necessary to run the procedure. One of them
is the text parameter that is defined as follows:

insertcommand.Parameters.Add(New SqlParameter("@dotnet.itags.org.texto", SqlDbType.Text,
2147483647))
insertcommand.Parameters("@dotnet.itags.org.texto").Value = texto.Text
Does someone knows what is causing this problem ?

ThanksHi,

Why do you think it's empty?
Normally, when you use SQL Server Enterprise Manager to
open a table with text field, it shows actual content when
it's <= 900 characters, but <Long Text> when it's > 900
characters. Actual content is in table. If you use Select
query in Query Analyzer, you can see the difference.

Hope it's helpful
Elton Wang
elton_wang@.hotmail.com

>--Original Message--
>I'm trying to insert a record on an sql server database
table that has
>among others a text type field. The insert happens
without errors and
>all the fields show the correct information except for
the text field
>when the number of characters is larger than 900. In this
case the text
>field appears empty. If the text is less or equal to 900
characters
>they are inserted with no problem.
>In this case have a stored procedure with several input
variables
>including the text one and a asp.net page with a command
that is filled
>with the several parameters necessary to run the
procedure. One of them
>is the text parameter that is defined as follows:
>insertcommand.Parameters.Add(New SqlParameter("@.texto",
SqlDbType.Text,
>2147483647))
>insertcommand.Parameters("@.texto").Value = texto.Text
>Does someone knows what is causing this problem ?
>Thanks
>.
Yo're right, Elton. I didn't knew about the EM limitation. Once I used
the QA the information appeared. Thanks!

Text field is empty

I'm trying to insert a record on an sql server database table that has
among others a text type field. The insert happens without errors and
all the fields show the correct information except for the text field
when the number of characters is larger than 900. In this case the text
field appears empty. If the text is less or equal to 900 characters
they are inserted with no problem.
In this case have a stored procedure with several input variables
including the text one and a asp.net page with a command that is filled
with the several parameters necessary to run the procedure. One of them
is the text parameter that is defined as follows:
insertcommand.Parameters.Add(New SqlParameter("@dotnet.itags.org.texto", SqlDbType.Text,
2147483647))
insertcommand.Parameters("@dotnet.itags.org.texto").Value = texto.Text
Does someone knows what is causing this problem ?
ThanksYo're right, Elton. I didn't knew about the EM limitation. Once I used
the QA the information appeared. Thanks!

Tuesday, March 13, 2012

TextBox AutoPostBack=false question (bug?)

Hello,
I have a strange yet very simple problem with the asp.net Textbox web contro
l.
On an empty asp.net page, add a single asp:TextBox control with
Autopostback=false with nothing else on the page.
according to the doc, hitting Enter while the TextBox has focus should do
nothing since Autopostback=false. The problem i have is that it posts the
form (that is, it ignores the Autopostback=false).
Now if i add another textbox to the page, i no longer experience the
problem(''?).
Is my framework (2.0) corrupted or is anyone else able to reproduce that bug
?
Thanks for any help
Renaud
=============
sample page
<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<html>
<body>
<form id="form1" runat="server">
<asp:TextBox runat="server" ID="txt" AutoPostBack="false"
></asp:TextBox>
</form>
</body>
</html>Apparently this is the default behavior of an ASP.NET page with only one
textbox on it. For example if there were a page that had a search textbox an
d
no button to submit the search, you could type in a search term and hit the
ENTER key and the form would be submitted.
There are lots of techniques and new features in ASP.NET 2.0 that let you
customize this type of behavior, such as the "defaultbutton" property of the
FORM element.
But the bottom line is, there's nothing wrong with your Framework - that's
just "the way it is".
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Renaud Langis" wrote:

> Hello,
> I have a strange yet very simple problem with the asp.net Textbox web cont
rol.
> On an empty asp.net page, add a single asp:TextBox control with
> Autopostback=false with nothing else on the page.
> according to the doc, hitting Enter while the TextBox has focus should do
> nothing since Autopostback=false. The problem i have is that it posts the
> form (that is, it ignores the Autopostback=false).
> Now if i add another textbox to the page, i no longer experience the
> problem(''?).
> Is my framework (2.0) corrupted or is anyone else able to reproduce that b
ug?
> Thanks for any help
> Renaud
> =============
> sample page
> <%@. Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
> Inherits="_Default" %>
> <html>
> <body>
> <form id="form1" runat="server">
> <asp:TextBox runat="server" ID="txt" AutoPostBack="false"
> </form>
> </body>
> </html>
The main problem with this behavior is that it bypasses the control
validations.
If the textbox is a TextBoxValidator, hitting the enter key posts the form
even if the textbox content breaks the validation rules. Validations are
performed correctly on the server side but it's still a useless roundtrip to
the server.
I suppose this could be corrected by using a button on the page. The problem
is, in our application, buttons are replaced by LinkButtons.
Thanks for your quick answer.
Renaud
"Peter Bromberg [C# MVP]" wrote:
> Apparently this is the default behavior of an ASP.NET page with only one
> textbox on it. For example if there were a page that had a search textbox
and
> no button to submit the search, you could type in a search term and hit th
e
> ENTER key and the form would be submitted.
> There are lots of techniques and new features in ASP.NET 2.0 that let you
> customize this type of behavior, such as the "defaultbutton" property of t
he
> FORM element.
> But the bottom line is, there's nothing wrong with your Framework - that's
> just "the way it is".
> Peter
> --
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> Short urls & more: http://ittyurl.net
>
>
> "Renaud Langis" wrote:
>
Have you tried something like adding another Textbox to your page, and
setting its width property to zero?
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Renaud Langis" wrote:
> The main problem with this behavior is that it bypasses the control
> validations.
> If the textbox is a TextBoxValidator, hitting the enter key posts the form
> even if the textbox content breaks the validation rules. Validations are
> performed correctly on the server side but it's still a useless roundtrip
to
> the server.
> I suppose this could be corrected by using a button on the page. The probl
em
> is, in our application, buttons are replaced by LinkButtons.
> Thanks for your quick answer.
> Renaud
> "Peter Bromberg [C# MVP]" wrote:
>
Yes, i solved it by adding a TextBox with display:none
It's not nice but it works...
Thanks
Renaud
"Peter Bromberg [C# MVP]" wrote:
> Have you tried something like adding another Textbox to your page, and
> setting its width property to zero?
> Peter
> --
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> Short urls & more: http://ittyurl.net
>
>
> "Renaud Langis" wrote:
>

TextBox AutoPostBack=false question (bug?)

Hello,

I have a strange yet very simple problem with the asp.net Textbox web control.

On an empty asp.net page, add a single asp:TextBox control with
Autopostback=false with nothing else on the page.

according to the doc, hitting Enter while the TextBox has focus should do
nothing since Autopostback=false. The problem i have is that it posts the
form (that is, it ignores the Autopostback=false).

Now if i add another textbox to the page, i no longer experience the
problem(?????).

Is my framework (2.0) corrupted or is anyone else able to reproduce that bug?

Thanks for any help

Renaud

=============
sample page
<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<html>
<body>
<form id="form1" runat="server">
<asp:TextBox runat="server" ID="txt" AutoPostBack="false"

Quote:

Originally Posted by

></asp:TextBox>


</form>
</body>
</html>Apparently this is the default behavior of an ASP.NET page with only one
textbox on it. For example if there were a page that had a search textbox and
no button to submit the search, you could type in a search term and hit the
ENTER key and the form would be submitted.

There are lots of techniques and new features in ASP.NET 2.0 that let you
customize this type of behavior, such as the "defaultbutton" property of the
FORM element.

But the bottom line is, there's nothing wrong with your Framework - that's
just "the way it is".
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Renaud Langis" wrote:

Quote:

Originally Posted by

Hello,
>
I have a strange yet very simple problem with the asp.net Textbox web control.
>
On an empty asp.net page, add a single asp:TextBox control with
Autopostback=false with nothing else on the page.
>
according to the doc, hitting Enter while the TextBox has focus should do
nothing since Autopostback=false. The problem i have is that it posts the
form (that is, it ignores the Autopostback=false).
>
Now if i add another textbox to the page, i no longer experience the
problem(?????).
>
Is my framework (2.0) corrupted or is anyone else able to reproduce that bug?
>
Thanks for any help
>
Renaud
>
=============
sample page
<%@. Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<html>
<body>
<form id="form1" runat="server">
<asp:TextBox runat="server" ID="txt" AutoPostBack="false"

Quote:

Originally Posted by

</asp:TextBox>


</form>
</body>
</html>


The main problem with this behavior is that it bypasses the control
validations.
If the textbox is a TextBoxValidator, hitting the enter key posts the form
even if the textbox content breaks the validation rules. Validations are
performed correctly on the server side but it's still a useless roundtrip to
the server.

I suppose this could be corrected by using a button on the page. The problem
is, in our application, buttons are replaced by LinkButtons.

Thanks for your quick answer.

Renaud

"Peter Bromberg [C# MVP]" wrote:

Quote:

Originally Posted by

Apparently this is the default behavior of an ASP.NET page with only one
textbox on it. For example if there were a page that had a search textbox and
no button to submit the search, you could type in a search term and hit the
ENTER key and the form would be submitted.
>
There are lots of techniques and new features in ASP.NET 2.0 that let you
customize this type of behavior, such as the "defaultbutton" property of the
FORM element.
>
But the bottom line is, there's nothing wrong with your Framework - that's
just "the way it is".
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
>
>
>
>
"Renaud Langis" wrote:
>

Quote:

Originally Posted by

Hello,

I have a strange yet very simple problem with the asp.net Textbox web control.

On an empty asp.net page, add a single asp:TextBox control with
Autopostback=false with nothing else on the page.

according to the doc, hitting Enter while the TextBox has focus should do
nothing since Autopostback=false. The problem i have is that it posts the
form (that is, it ignores the Autopostback=false).

Now if i add another textbox to the page, i no longer experience the
problem(?????).

Is my framework (2.0) corrupted or is anyone else able to reproduce that bug?

Thanks for any help

Renaud

=============
sample page
<%@. Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<html>
<body>
<form id="form1" runat="server">
<asp:TextBox runat="server" ID="txt" AutoPostBack="false"

Quote:

Originally Posted by

></asp:TextBox>


</form>
</body>
</html>


Have you tried something like adding another Textbox to your page, and
setting its width property to zero?
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Renaud Langis" wrote:

Quote:

Originally Posted by

The main problem with this behavior is that it bypasses the control
validations.
If the textbox is a TextBoxValidator, hitting the enter key posts the form
even if the textbox content breaks the validation rules. Validations are
performed correctly on the server side but it's still a useless roundtrip to
the server.
>
I suppose this could be corrected by using a button on the page. The problem
is, in our application, buttons are replaced by LinkButtons.
>
Thanks for your quick answer.
>
Renaud
>
"Peter Bromberg [C# MVP]" wrote:
>

Quote:

Originally Posted by

Apparently this is the default behavior of an ASP.NET page with only one
textbox on it. For example if there were a page that had a search textbox and
no button to submit the search, you could type in a search term and hit the
ENTER key and the form would be submitted.

There are lots of techniques and new features in ASP.NET 2.0 that let you
customize this type of behavior, such as the "defaultbutton" property of the
FORM element.

But the bottom line is, there's nothing wrong with your Framework - that's
just "the way it is".
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
"Renaud Langis" wrote:

Quote:

Originally Posted by

Hello,
>
I have a strange yet very simple problem with the asp.net Textbox web control.
>
On an empty asp.net page, add a single asp:TextBox control with
Autopostback=false with nothing else on the page.
>
according to the doc, hitting Enter while the TextBox has focus should do
nothing since Autopostback=false. The problem i have is that it posts the
form (that is, it ignores the Autopostback=false).
>
Now if i add another textbox to the page, i no longer experience the
problem(?????).
>
Is my framework (2.0) corrupted or is anyone else able to reproduce that bug?
>
Thanks for any help
>
Renaud
>
=============
sample page
<%@. Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<html>
<body>
<form id="form1" runat="server">
<asp:TextBox runat="server" ID="txt" AutoPostBack="false"
</asp:TextBox>
</form>
</body>
</html>


Yes, i solved it by adding a TextBox with display:none

It's not nice but it works...

Thanks

Renaud

"Peter Bromberg [C# MVP]" wrote:

Quote:

Originally Posted by

Have you tried something like adding another Textbox to your page, and
setting its width property to zero?
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
>
>
>
>
"Renaud Langis" wrote:
>

Quote:

Originally Posted by

The main problem with this behavior is that it bypasses the control
validations.
If the textbox is a TextBoxValidator, hitting the enter key posts the form
even if the textbox content breaks the validation rules. Validations are
performed correctly on the server side but it's still a useless roundtrip to
the server.

I suppose this could be corrected by using a button on the page. The problem
is, in our application, buttons are replaced by LinkButtons.

Thanks for your quick answer.

Renaud

"Peter Bromberg [C# MVP]" wrote:

Quote:

Originally Posted by

Apparently this is the default behavior of an ASP.NET page with only one
textbox on it. For example if there were a page that had a search textbox and
no button to submit the search, you could type in a search term and hit the
ENTER key and the form would be submitted.
>
There are lots of techniques and new features in ASP.NET 2.0 that let you
customize this type of behavior, such as the "defaultbutton" property of the
FORM element.
>
But the bottom line is, there's nothing wrong with your Framework - that's
just "the way it is".
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net
>
>
>
>
"Renaud Langis" wrote:
>
Hello,

I have a strange yet very simple problem with the asp.net Textbox web control.

On an empty asp.net page, add a single asp:TextBox control with
Autopostback=false with nothing else on the page.

according to the doc, hitting Enter while the TextBox has focus should do
nothing since Autopostback=false. The problem i have is that it posts the
form (that is, it ignores the Autopostback=false).

Now if i add another textbox to the page, i no longer experience the
problem(?????).

Is my framework (2.0) corrupted or is anyone else able to reproduce that bug?

Thanks for any help

Renaud

=============
sample page
<%@. Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<html>
<body>
<form id="form1" runat="server">
<asp:TextBox runat="server" ID="txt" AutoPostBack="false"
></asp:TextBox>
</form>
</body>
</html>