 |
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

January 25th, 2006, 02:16 AM
|
Authorized User
|
|
Join Date: Jan 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Text Box width
Hi all
I am using the width of textbox in %, its changing the width of textbox in case the no. of characters are more.
Though its working fine with width in pixels, but I want a solution for width in %.
Thanks & Regards
|

January 25th, 2006, 09:42 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Are you saying that it IS changing based on the number of chars in the textbox, or that you WANT it to change based on the number of chars in it?
- Peter
|

January 27th, 2006, 05:33 AM
|
Authorized User
|
|
Join Date: Jan 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by planoie
Are you saying that it IS changing based on the number of chars in the textbox, or that you WANT it to change based on the number of chars in it?
-Peter
|
Hi Peter
Thanku so much for the reply.
If data coming from database is lengthier then it expands, I have limited space so I donât want the textbox to expand.
|

January 27th, 2006, 07:36 AM
|
Registered User
|
|
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi
I know your meaning,but I don't know how to do it,I'm a newbie in here.
:P
Coffee
A new man .
|

January 27th, 2006, 10:46 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Set an explicit width for the textbox control:
<asp:textbox ... width="100" />
- Peter
|

February 1st, 2006, 09:27 AM
|
Authorized User
|
|
Join Date: Jan 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
quote:Originally posted by planoie
Set an explicit width for the textbox control:
<asp:textbox ... width="100" />
-Peter
|
Hi Peter
Thanku again for ur reply.
But this(<asp:textbox ... width="100" />) sets value in pixels, I want to use %
Thanks & Regards
|

February 2nd, 2006, 05:52 AM
|
Authorized User
|
|
Join Date: May 2005
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi Peter,
Why dont you set the Multiline property to TRUE and specify the width in %.
Let me know if it works.
Regards,
Muskaan. :)
|

February 3rd, 2006, 07:15 AM
|
Registered User
|
|
Join Date: Dec 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi toshi,
I agree to Muskaan.
Using the Multiline property to TRUE and specify the width in % will solve the issue.
Regards,
Munavvar
|

March 30th, 2006, 03:40 AM
|
Authorized User
|
|
Join Date: Jan 2006
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks for ur reply but i have a set format so cant use miltiline textbox too...
|

March 30th, 2006, 02:20 PM
|
Wrox Author
|
|
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
|
|
so what your saying is is that you have a text feed coming from somewhere that has to be on one line? What I recommend doing is something like this
Dim strMyString as string
Dim intLength as integer
///retrieve your data set the string to the above variable
intLength = strMyString.length
///You now know the length of the string so preform your calculation on what
///the width of the text box should be then do this
txtMyBox.style.add("width",[percent])
where percent is how much of the screen you want the box to occupy. Note that this is going to be your only work around pragmatically because the Width() of the text box only accepts an integer. (Unless of course you create a math function that will convert your percent into an integer based upon the available screen size.)
Hope this helps.
"The one language all programmers understand is profanity."
|
|
 |