controlling how much text panel displays

I have a panel in a server side table that looks like this:

<div style="text-align:left;">
    <asp:Label ID="SubjectLabel" runat="server" Text='<%# Ucase(Eval("Subject")) %>' />
    <br /><br />
    <asp:Panel ID="Panel1" runat="server" Height="165px" ScrollBars="None" HorizontalAlign="Left">
        <asp:Label ID="EntryLabel" runat="server" Text='<%# Eval("Entry") %>' />
    </asp:Panel>
</div>

I was hoping that by setting a height and by setting scrollbars to none, I could control the number of lines of text that gets displayed.  Below the panel I want to put a link to the full text on another page.  I don't want to display a specific number of characters, because that number will change depending on monitor size and screen resolution.  

I tried this, and the text happily overruns the panel.  Is this what it should do, or do I somehow  not have tghe label properly associated with the panel?

0
Mainship
5/4/2009 5:43:17 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

1 Replies
1087 Views

Similar Articles

[PageSpeed] 9

 Well you can always trim your text first say upto some specific letters and then display  (...) alone with your text. Something like this:

EntryLabel.Text.Substring(0,10)  + "..."

So if your Text is : This is just a test, doing above will do: This is just....


Thanks,
Karan

~ Remember To Mark The Post(s) That Helped You As The ANSWER ~
0
karan
5/4/2009 5:53:32 PM
Reply:

Similar Artilces:

Sharepoint help! Error msg : "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe"
hihi, I have set up a testing virtual server on my local machine. I installed win server 2003, wss 2.0, sql server 2000, and visual studio .net 2003. i tried to create a project in C# but when i build it and import the web part (.dwp) into the page, there is this error msg "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe"  I seached most of the sites and they informed that the problem lies in the safe control in web.config i enter the safe control in web.config but i does not know where to put ...

Controlling web control instances on Web Form
I have created a composite control, extending functionality of the Hidden Control. However, I would like to prevent the user from adding this control to the page multiple times. I only want one instance of the control on the Web Form. What setting in my project to I adjust to enable this functionality? I can not find it in any of the books that I have referenced. Is this a setting or is this code that has to be added to the inheriting class. Looks like there is no standard apporach. But I'd consider using static field to count number of created objects and throw exception if second object ...

C#.NET WEB APPLICATION
hei guys, i need help on my application, i'm using C#.NET as front-ed and SQL as back-end, aside from a datagrid, i want to display my data using textboxes and not a datagrid, i can do it using Visual Basic 6 but since i'm a newbee at C#.NET i don't know how to do it, specially the codes, can anyone help me with it? thank you in advance! If you are doing windows development, i would suggest using 'DataForm wizard' (Use Solution Explorer-->Rightclick project-->Add new Item-->New DataForm). It will guide you through steps. If you are doing web apps. Use quickstart to learn them. h...

Strange output in web form after web form is displayed.
   I have been using a web user control for over a week now with no problems. I am now getting strange output in my web form after my controls display on the page. Below is the strange output. Can anyone tell me what is wrong here? Note I did not include it all because it is quite large.   Request Details Session Id: l5b5vkazucfatba4oliaw1vi Request Type: POST Time of Request: 9/10/2007 4:59:59 PM Status Code: 200 Request Encoding: Unicode (UTF-8) Response Encoding: Unicode (UTF-8) Trace Information Category Message From First(s) F...

how to call controls of web control form in coding of other forms?
hello everyone i have one problem i have created one webcontrol shoppingcart in which there are two labels one of qty and other of amt which are initially enable =falsenow on other page(aspx page) i have one txtbox of qty as txtqty i want tat as soon as user enters qty txtqty and clicks on add cart button it shd be display d value in lblqty of web control shopping cart make sure i m using datalist on aspx page so give me suggestions on tat basis and my coding is in vb. plz give ur suggestions as fast as possible. Neeti what do you mean by webcontrol.... it this user control or normal ...

How to access a control on a web form from anoter web form
hi all I have this scenarios i have two web forms, one called form1 and the other called form2 form1 has a label with id "lbl1" is it possible to access lbl1 from form2, change its text permenantly? thanks.   refer: http://dotnetslackers.com/Community/blogs/haissam/archive/2007/11/26/ways-to-pass-data-between-webforms.aspxSSNPlease remember to click "Mark as Answer" on the post that helps you. MinaSamy: hi all I have this scenarios i have two web forms, one called form1 and the other called form2 form1 has a label with id "lbl1" is it p...

Urgent!!! Form inside Windows form control (that is embedded to Web page i.e aspx), not displayed on button click
 Hi all I have a Windows Form Control(i.e Windows Control Library), that consists of a Button "button1" and  a panel "panel1". Also I have a form "form1.cs". On form "form1.cs" I have a label whose text value i have set to  "Hi". On click of button "button1" on windows form control i am opening the form "form1.cs"  inside a panel and it displays "Hi". The code of windows form control is as below :  public partial class UserControl1 : UserControl    {    ...

Displaying text and graphics in a web form
Hi: I want to display a DataBase field in some part of a webform. However, this field should have text and graphics (BMP, JPG, GIF, etc). Is there some control to use for this? At first, I though I could use HTML format for this field, so the text and graphics appear like in a "web page" (that is, I would have the text in the HTML and the graphics using the IMG tag. However, I don't know how to visualize a "web page" inside another "web page" (the web form)... Is there any way to accomplish this?   Regards; Gus pardon me if i am wrong... but it...

Certain web form controls...not displaying. Why?
Greetings: I've created my first web form adding some web controls like a label, button, and calendar. However, upon compile, only the label displays...why's that? I can view the HTML source code for all the controls though. (Initially, I got the message "Unable to start debugging on the web server", but have been able to run the form w/o debugging turned-on.) I'm using probably the first version of .NET's Visual Stuido (2001) with IIS on my machine. BTW...my study Windows apps have been working fine. Any and all guidance will be greatly appreciated. Ed in TampaEd in Ta...

Web control does net load display
I stat doing my First ASP.NET Page Hello world Using web control "label , button and textbox" I run it using the matrix server and it shows everything. When I try to use IIS 5.1 it only show the text in my case it was Label All I can see in the page is "Label" no button or text field What shall i do to correct this and how can i switch between running it in matrix server and iis Thank you. are you opening internet explorer to run it? Post your code so we can see if it has any problems... ************* Edited by moderator Adec *******...

.Net Windows Control in Web Form
Hi all,How can I use a .Net windows control in a web form? I use object tag but it doesn't work and displays empty.Thanks in advance cheers Hi, you can check this article out: Hosting a Windows Control in a Web Form. This shows only how to host the control. If you want interaction with the client you can do this by setting the correct CAS (Code Access Security) settings on the client pc. Grz, Kris.Read my blog. Handy Firefox plugins for web developers.Workaround for non working Mark as answer buttons. Thanks guys for your replycheers...

Problem displaying web form controls
Does anyone know why some server controls (textbox, datagrid, image obj) display data normally on clients running Windows XP Pro but not on clients running Windows 2K Pro/Windows XP Home/Windows Me? They are all using IE60 and Framework 11. I am running out of ideas. Thanks for any expert advice. chokk Are they viewing the files from your server over the web, or do they have the .aspx files on their hard drive? If they're viewing them from their hard drive, they'd have to enable IIS and make sure that IIS uses the directories that these files are in....

IE Web Controls display text only
I just installed Visual Web Developer Express 2005 along with it's web server SQL Express. I have installed the IE Web Controls and followed the instructions but can't get any of the 4 controls to display anything but text. My root isn't c:\inetpub\wwwroot because SQL Express is looking at my project located under My Docs\Visual Studio 2005\Websites\MyWebName as the root it appears anyway. Has anyone been able to get this type of setup with VWD Express w/ SQL Express and IE Web Controls to work? Thanks in advance. Don I finally found my problem by searching through these forums for a few...

Can you return .net web controls in a .net page from a web service?
I've got a problem with a project. I've got to compile an entire .net page and return it as part of a Web Service for display. The problem I have is that I need to add WebControls and functionality to the page so that not only the html content and images are displayed (which I've managed) but that textboxes, labels, buttons and datasets can be displayed also. Essentially I need to make a call from one site for a page, populate the page and return it in a state as though it resided on the same server/webspace as the calling page. Code is currently built as follows into a string: strOpenHT...

Web resources about - controlling how much text panel displays - asp.net.web-forms

Talk:Controlling for a variable - Wikipedia, the free encyclopedia
This article is within the scope of the WikiProject Statistics , a collaborative effort to improve the coverage of statistics on Wikipedia. If ...

Controlling What You Share on Timeline - Facebook
Facebook and Privacy hat eine Notiz mit dem Titel Controlling What You Share on Timeline geschrieben. Du kannst den vollständigen Text hier lesen. ...

Balloon Snake - Pop Balloons by Controlling a Bird with the Accelerometer or by Touching on the App Store ...
Get Balloon Snake - Pop Balloons by Controlling a Bird with the Accelerometer or by Touching on the App Store. See screenshots and ratings, and ...

Controlling a Computer with Eyes - Flickr - Photo Sharing!
Some folks know I work with assistive technology, and this shot is one from many I took in the last few days at a conference in Phoenix. This ...

Controlling Doepfer modular synth with a Wiimote - YouTube
This video is about controlling a modular synth with Nintendo's wiimote gamepad, using Doepfer A-100, Doepfer MCV24, Wiimote and computer. Softwares ...

Controlling the minds of cockroaches using Microsoft's Xbox Kinect
Late last year, you were introduced to real, live, remote-controlled cockroaches. Well, the insect hackers at the North Carolina State University ...

CONTROLLING CHAOS: Twitter's Wild Ride From Doodle To IPO
CONTROLLING CHAOS: Twitter's Wild Ride From Doodle To IPO Business Insider Australia “We apologise if the following profile lacks our usual ...

View from the Street: Power to the people controlling the power!
Your news of the day, reduced to a snarky rant.

Dying to be clean: The new technique for controlling feral cats
Cleanliness may be next to godliness unless you're a feral cat, in which case, cleanliness may get you a place next to god. In kitty heaven, ...

Fears Of Telstra controlling NBN - Nextgen - AAPT - Optus - HarbourIT - Budde
The NBN was supposed to create a level playing field, but there are fears that Telstra could still exert bottleneck control over access to customers, ...

Resources last updated: 11/25/2015 7:27:12 PM