Is there a character limit on bound controls?

P

pedalchick

I'm trying to build a mini-CMS for a friend (ASP.NET 2.0/VB) - just a
simple admin page w/ a text box and button that inserts some text into
a database (I'm using Access 2003 - text is going into a Memo field)
that will subsequently be fed to a page to display. The insert works
just fine - I've put more than 1,000 characters in without incident.
However, on the page that needs to display the text, the text is
truncated to about 200 characters.

On the display page I have my Access datasource that is pulling the
last updated record from the database. Then, I have tried a "details
view" and a Form View with the text bound to a label inside an item
template. In either case, the text is truncated.

More info: The text will contain basic HTML tags. In the form view,
the HTML is rendered properly, but in the details view it was coming
out as text tags. The truncation happens regardless of whether there
are tags or not.

I'm sure there's a simple solution, but I've looked through all the
properties on the controls and can't find anything that might be
limiting the length of the text.

Please help.

TIA,
Laura
 
M

Marina Levit [MVP]

No, there is no limit.

Are you sure all 1000 characters are going into the database? Just because
there is no error, doesn't mean they all went into the database.
 
P

pedalchick

Marina said:
No, there is no limit.

Are you sure all 1000 characters are going into the database? Just because
there is no error, doesn't mean they all went into the database.

Yes - I can open Access and see everything. I just put text + spaces,
no special characters...
The text is being truncated to 225 characters.

Here is the display page code (my latest attempt)
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master"
Title="Untitled Page" %>
<script runat=server>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

AccessDataSource1.SelectParameters.Item("event_id").DefaultValue =
ConfigurationManager.AppSettings("event_id")

End Sub
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/database/FC1.mdb"
SelectCommand="SELECT MAX([stage_num]), [event_id],
[stage_overview] FROM [tblStage] WHERE ([event_id] = ?) and
[stage_overview] IS NOT NULL GROUP BY [event_id], [stage_overview]">
<SelectParameters>
<asp:parameter Name="event_id" Type="Int32" />
</SelectParameters>
</asp:AccessDataSource>
<br />
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="AccessDataSource1">
<ItemTemplate>
<asp:Label ID="lblOverview" CssClass=default runat="server"
Text='<%# Bind("stage_overview") %>' />
</ItemTemplate>
</asp:Repeater>
</asp:Content>
 
M

Marina Levit [MVP]

When you look at the generated HTML, does it still have just 225 characters?
Do you have more then one item in your repeater, and every one is just 225?
Are any of the characters special HTML characters that your text contains
that could be messing it up?

Also, try a textbox instead of a label.

225 in general does not have any significance, as far as I know.

pedalchick said:
No, there is no limit.

Are you sure all 1000 characters are going into the database? Just
because
there is no error, doesn't mean they all went into the database.

Yes - I can open Access and see everything. I just put text + spaces,
no special characters...
The text is being truncated to 225 characters.

Here is the display page code (my latest attempt)
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master"
Title="Untitled Page" %>
<script runat=server>
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

AccessDataSource1.SelectParameters.Item("event_id").DefaultValue =
ConfigurationManager.AppSettings("event_id")

End Sub
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
<asp:AccessDataSource ID="AccessDataSource1" runat="server"
DataFile="~/database/FC1.mdb"
SelectCommand="SELECT MAX([stage_num]), [event_id],
[stage_overview] FROM [tblStage] WHERE ([event_id] = ?) and
[stage_overview] IS NOT NULL GROUP BY [event_id], [stage_overview]">
<SelectParameters>
<asp:parameter Name="event_id" Type="Int32" />
</SelectParameters>
</asp:AccessDataSource>
<br />
<asp:Repeater ID="Repeater1" runat="server"
DataSourceID="AccessDataSource1">
<ItemTemplate>
<asp:Label ID="lblOverview" CssClass=default runat="server"
Text='<%# Bind("stage_overview") %>' />
</ItemTemplate>
</asp:Repeater>
</asp:Content>
 
P

pedalchick

Marina said:
When you look at the generated HTML, does it still have just 225 characters?
Do you have more then one item in your repeater, and every one is just 225?
Are any of the characters special HTML characters that your text contains
that could be messing it up?

Also, try a textbox instead of a label.

225 in general does not have any significance, as far as I know.

Hello Marina,
It doesn't matter what the control is - text box, label, gridview,
detail view: it always comes up truncated. I've never come up against
this problem before. It seems like the truncation must be occuring
when I retrieve the data from the database. It may be a MS Access
issue, but I have never had this problem before...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top