Showing posts with label html. Show all posts
Showing posts with label html. Show all posts

Saturday, March 31, 2012

text box validation

I am using html text box, and the text area in my asp.net applicatioon c# rather than using the web form "text bpxes"

I then put a validator the typical one that VS.net provides and a web form submit

the validator makes sure that the text boses are fill...but when I hit submit nothing happens even when I fill the boxes ... I can see that the page is not even going back to the server

any ideas

WashingtonHi,

please provide the code that doesn't work out for you and be sure to use the apropriate tags (view post 98605).

On the other hand, I don't think it's possible to set theControlToValidate Property of a normal html textbox that isn't registered as a htmlcontrol (with the attribute runat="server").

Grz, Kris.
There is a bug in the client-side scripting for ASP.NET 1.1 SP1. Please see this thread for a solution:http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=739537

Wednesday, March 28, 2012

Text Comparision in XSLT

hi guys,

I am working with XSLT these days. XSLT i am using is generating a HTML using a xml doc and list of arguments.

I also have a list of strings stored somewhere in cache. now I need to check if text coming from XML contains a word from string list...provide a link to that word.

Storing that string list can be changed to some text file or DB whatever is possible.

Now is it possible to do string comparision through XSLT??

Please reply asap...thanks.

-Geek

Hi

I think you can, using something like

<xsl: for-each select="t:fieldName">
<xsl: choose>

<xsl: when test="contains('value')">
' do what you want to do here
</xsl: when>

<xsl: when test="contains"('anothervalue')">
'do what you want to do here
</xsl: when>

</xsl: choose>
<xsl: for-each>

Hope that helps

text document into html template

hi,
can any one help me to convert a normal text document into a html template. I have around 50docs need to convert them into html templates and use those templates to generate html reports.
Thanks in advance,,chandras17--
Regarding this...

chandras17 wrote:

...can any one help me to convert a normal text document into a html template...


...it is not quite clear to me what you mean by "html template", but...
...one quick and simple way to display a text document in a browser is to surround the text by pre tags and give the document an "htm" extension...
...for example, suppose the file "Test.txt" contains the following...


This some sample text.
It is in a file.
The file is a plain text file.


...then, to view that file in a browser, one can simply copy the file, rename the copy to "Test.txt.htm", and change the contents to the following...


<pre>
This some sample text.
It is in a file.
The file is a plain text file.
</pre>


...and then load "Test.txt.htm" into a browser.
That is a simple way.
The case shown is simple; you do need to handle special characters. You can see some sample code in my "dirt-simple" code-viewer, (but you will have to download the code and pull it apart because it doesn't exactly fit your requirement), found at...
http://www.WebLogicArts.com/DemoList.aspx
HTH.

Text editor

I want to create a simple text editor for my site so that administrators can update website content without having to know html. So for example in the text box they hit the enter key and it automatically inserts the <p></p> tags, and of course more advanced functions.

Does anyone know a good tutorial or something that tells me how i can achieve this?

thanks.www.richtextbox.com
Hello,

maybe a "HTML viewing and editing" component which is developed by the "WebMatrix"-Team is very helpful for you. Even if this component is developed as a WinForms-Application in C# you can see the complete source for developing a text editor where you can input and format a free text and then convert it to HTML-source.

You can download the component here:HTML viewing and editing component

HTH,

Text element's width is too wide when doctype is set to XHTML

I've read a bunch of posts on this and none of the answers are
legitimate (IMHO) so I thought I'd throw it out there again.

Using the html code below, if you set the doctype to HTML 4.0, and
view the page in IE 6 or 7, the text element fills the table cell
perfectly.
If you change the doctype to XHTML 1.0, the text element extends
beyond the width of the table cell.
On the other hand, if you view the page in FireFox, the page displays
perfectly regardless of which doctype you use.

I'm really looking for a better solution than to set the doctype to
HTML 4.0. Or perhaps is this just another anomaly in IE?

Please note that I have included both doc type headers. The first
doctype header is always used so just reverse the order to try each
one out.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<table>
<tr>
<td width="200">
<input type="text" style="width:100%" />
</td>
</tr>
</table>
</body>
</html>you just need to understand html 4.0. object have a width, border and
margin. the border and margin extend beyond the width. so if you make an
object 100px wide with a 2px margin and a 2px border it will be 108px
wide. if you make the width 100% (of the parent), with margin and border
it will be 8px wider than the parent. now if the parent has padding the
control is offset and will extend beyond the parent unless overflow is set.

because you are not setting the borders, margins, and padding, you get
the default, which differs by browser.

-- bruce (sqlwork.com)

mszanto@.hotmail.com wrote:

Quote:

Originally Posted by

I've read a bunch of posts on this and none of the answers are
legitimate (IMHO) so I thought I'd throw it out there again.
>
Using the html code below, if you set the doctype to HTML 4.0, and
view the page in IE 6 or 7, the text element fills the table cell
perfectly.
If you change the doctype to XHTML 1.0, the text element extends
beyond the width of the table cell.
On the other hand, if you view the page in FireFox, the page displays
perfectly regardless of which doctype you use.
>
I'm really looking for a better solution than to set the doctype to
HTML 4.0. Or perhaps is this just another anomaly in IE?
>
Please note that I have included both doc type headers. The first
doctype header is always used so just reverse the order to try each
one out.
>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<table>
<tr>
<td width="200">
<input type="text" style="width:100%" />
</td>
</tr>
</table>
</body>
</html>
>


I've done a bit more research, and understand what you mean, but that
that really only applies for XHTML doctypes. HTML doc types
automatically take these other factors into account when determining
the display width of an object whose style width is set to 100%.

Apparently XHTML uses a strict box model which really causes a lot of
aggravation when laying out a web page. Another example being that you
can't set the height of a Table inline, you have to set it in the
style sheet. I'm okay with that as long as the XHTML doctype is used
in the appropriate situations.

Having said all that, why oh why did Microsoft decide to set the
default doctype to XHTML for new WebForms in VS 2005. That is
completely idiotic considering the aggravation it will cause for the
majority of developers.

mike

Text element's width is too wide when doctype is set to XHTML

I've read a bunch of posts on this and none of the answers are
legitimate (IMHO) so I thought I'd throw it out there again.
Using the html code below, if you set the doctype to HTML 4.0, and
view the page in IE 6 or 7, the text element fills the table cell
perfectly.
If you change the doctype to XHTML 1.0, the text element extends
beyond the width of the table cell.
On the other hand, if you view the page in FireFox, the page displays
perfectly regardless of which doctype you use.
I'm really looking for a better solution than to set the doctype to
HTML 4.0. Or perhaps is this just another anomaly in IE?
Please note that I have included both doc type headers. The first
doctype header is always used so just reverse the order to try each
one out.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<table>
<tr>
<td width="200">
<input type="text" style="width:100%" />
</td>
</tr>
</table>
</body>
</html>you just need to understand html 4.0. object have a width, border and
margin. the border and margin extend beyond the width. so if you make an
object 100px wide with a 2px margin and a 2px border it will be 108px
wide. if you make the width 100% (of the parent), with margin and border
it will be 8px wider than the parent. now if the parent has padding the
control is offset and will extend beyond the parent unless overflow is set.
because you are not setting the borders, margins, and padding, you get
the default, which differs by browser.
-- bruce (sqlwork.com)
mszanto@.hotmail.com wrote:
> I've read a bunch of posts on this and none of the answers are
> legitimate (IMHO) so I thought I'd throw it out there again.
> Using the html code below, if you set the doctype to HTML 4.0, and
> view the page in IE 6 or 7, the text element fills the table cell
> perfectly.
> If you change the doctype to XHTML 1.0, the text element extends
> beyond the width of the table cell.
> On the other hand, if you view the page in FireFox, the page displays
> perfectly regardless of which doctype you use.
> I'm really looking for a better solution than to set the doctype to
> HTML 4.0. Or perhaps is this just another anomaly in IE?
> Please note that I have included both doc type headers. The first
> doctype header is always used so just reverse the order to try each
> one out.
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
> www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <body>
> <table>
> <tr>
> <td width="200">
> <input type="text" style="width:100%" />
> </td>
> </tr>
> </table>
> </body>
> </html>
>
I've done a bit more research, and understand what you mean, but that
that really only applies for XHTML doctypes. HTML doc types
automatically take these other factors into account when determining
the display width of an object whose style width is set to 100%.
Apparently XHTML uses a strict box model which really causes a lot of
aggravation when laying out a web page. Another example being that you
can't set the height of a Table inline, you have to set it in the
style sheet. I'm okay with that as long as the XHTML doctype is used
in the appropriate situations.
Having said all that, why oh why did Microsoft decide to set the
default doctype to XHTML for new WebForms in VS 2005. That is
completely idiotic considering the aggravation it will cause for the
majority of developers.
mike

Saturday, March 24, 2012

text rendering problems

Hi - I have some text (type text) values stored in a SQL d-base (2005). The text already has html tags embedded in them. When I bind a value to a textbox for example it escapes the HTML values and does not treat them properly in the browser. How can I tell .NET (or SQL Server, not sure what is escaping the tags) to treat HTML tags in the text like HTML tags. For example if I view source on my aspx page I get the following:

This should be a <b> BOLD </b>

Making it not bold and actually showing the <b> </b> in the browser.

thanks

Paritally it's because controls like the TextBox cant handle HTML tags.

Also, look in the DB.. what's in there? The <..> or <... It may be a matter of how you are saving it


Use this controlhttp://freetextbox.com or use Response.Write(sbuffer);

Hope this helps

Al


the db does not have the < in the table. However, if the textbox control can't handle HTML tags that is probably it. Although I do not know what can't handle means. I would have guessed that the server side control itself does not handle the html tag....it would just spit the value out and the browser would handle it.

as far as the freetext box I will look at that...thanks.


What I mean by "cant handle" is that HTML is ignored.

Things like TextBox dont use HTML, only plain text. <b> is unknown to a TextBox where a Label understands it and interprets it, or rather allows the browser to...

text searching through html/.apx files in .net

I want to implement search engine that inputs from user then search all html or .aspx file and display results.
Kindly guide me how can i do this.
Any help/sample code will be appreciatedHi,
Take a look @.
-Creating Search Pages with Index Server and .NET

-WhatuSeek.com

HTH

Text to HTML

I have a text file perfectly formatted with carriage returns, indents,
spacing etc in NotePad. I want to put text that looks exactly like that
into a <div> and get it formatted exactly the same way in Visual Studio.
But I can't seem to get this done in Visual Studio other than pasting it
into a textbox - which I don't want to do.
If I paste it into a div in design view it removes all formatting. Same in
source view. If I put it into MS Word and save as plain html it puts all
sorts of gargage in it that doesn't work in VS.
Is there any program that will do this?
Thanks,
TPut the text into a <PRE>...</PRE> tag, which will hold on to the whitespace
formatting. You can put the PRE tag into a DIV tag if you want.
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OLc94tL5GHA.3376@.TK2MSFTNGP05.phx.gbl...
>I have a text file perfectly formatted with carriage returns, indents,
>spacing etc in NotePad. I want to put text that looks exactly like that
>into a <div> and get it formatted exactly the same way in Visual Studio.
>But I can't seem to get this done in Visual Studio other than pasting it
>into a textbox - which I don't want to do.
> If I paste it into a div in design view it removes all formatting. Same
> in source view. If I put it into MS Word and save as plain html it puts
> all sorts of gargage in it that doesn't work in VS.
> Is there any program that will do this?
> Thanks,
> T
>
Well, that works pretty good. Thanks.
Is there a way to get the text to wrap inside the PRE or the DIV?
Thanks,
T
"Scott M." <s-mar@.nospam.nospam> wrote in message
news:ulx$s1L5GHA.3452@.TK2MSFTNGP05.phx.gbl...
> Put the text into a <PRE>...</PRE> tag, which will hold on to the
> whitespace formatting. You can put the PRE tag into a DIV tag if you
> want.
>
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:OLc94tL5GHA.3376@.TK2MSFTNGP05.phx.gbl...
>
Oh, I also notice that text inside the PRE will not follow CSS specified
fonts so it looks like
it acts just like text in a text box and these are the reasons I did not
want to use a textbox.
T
"Scott M." <s-mar@.nospam.nospam> wrote in message
news:ulx$s1L5GHA.3452@.TK2MSFTNGP05.phx.gbl...
> Put the text into a <PRE>...</PRE> tag, which will hold on to the
> whitespace formatting. You can put the PRE tag into a DIV tag if you
> want.
>
> "Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
> news:OLc94tL5GHA.3376@.TK2MSFTNGP05.phx.gbl...
>
Sorry, you can't have it both ways. Use PRE and WYSIWYG, no more and no
less - don't use PRE and all white space is stripped.
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:OvyGZcO5GHA.3736@.TK2MSFTNGP02.phx.gbl...
> Well, that works pretty good. Thanks.
> Is there a way to get the text to wrap inside the PRE or the DIV?
> Thanks,
> T
> "Scott M." <s-mar@.nospam.nospam> wrote in message
> news:ulx$s1L5GHA.3452@.TK2MSFTNGP05.phx.gbl...
>
Again, that's what PRE does - uses a monospaced font.
You've got to remember the language you are working in. HTML is a language
where whitespace stripping occurs. If you want to build space back in, you
could look into entities such as (which will get messy). You could
read your text file and parse that file into <P>, <BR> and where you
read line breaks and spaces.
"Tina" <TinaMSeaburn@.nospamexcite.com> wrote in message
news:eqS$4fO5GHA.1248@.TK2MSFTNGP03.phx.gbl...
> Oh, I also notice that text inside the PRE will not follow CSS specified
> fonts so it looks like
> it acts just like text in a text box and these are the reasons I did not
> want to use a textbox.
> T
> "Scott M." <s-mar@.nospam.nospam> wrote in message
> news:ulx$s1L5GHA.3452@.TK2MSFTNGP05.phx.gbl...
>
PRE
{
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
Tina wrote:
> Well, that works pretty good. Thanks.
> Is there a way to get the text to wrap inside the PRE or the DIV?
> Thanks,
> T
> "Scott M." <s-mar@.nospam.nospam> wrote in message
> news:ulx$s1L5GHA.3452@.TK2MSFTNGP05.phx.gbl...

text to html

I have a text box on my website. How do I convert that text to html? The reason I want to do this is because I want <br> and stuff inserted once a user submits the text...

Can someone help me out please?I think I didn't explain myself well enough..

I have a textbox and when people type something out like this:

***************
This is my first line

This is my second line
***************

once I pull it out of a database, I want it to be displayed the same way... So it is displayed the way I type it out, like any of the posts on this board.

Can someone please help?
Assume that your text is stored in myString
If u want to convert it to html, use server.htmlencode(myString), it will convert sth. like "<" to "<". But it can't automatically generate <br>. So you have to use replace to do that

Finally, you can use
replace(server.htmlencode(myString), vbcrlf,"<br>")
BTW, basically, I will keep the original text in database, only encode them when output.
Why I do like that? Because when you want to update it, the html code will also be shown on the textbox for update, it confused the user much. So you'd better do the encoding in output, not do it when inserting it into database.
string temp = TextBox1.Text.ToString() + "<BR>";
Response.Write(temp);

that will do the trick
Thanks, got it working now...

Though there's a different way to encode it as html and stuff...
Thanks for the suggestion rgao906. It's a good idea
Lomex if you out three how do you do it?

when I used textbox.text i get a whole string like this:

Line 1. Line2.

I tried the above it doesn't insert the necessary <br
please help!

Text to HTML

I have a text file perfectly formatted with carriage returns, indents,
spacing etc in NotePad. I want to put text that looks exactly like that
into a <divand get it formatted exactly the same way in Visual Studio.
But I can't seem to get this done in Visual Studio other than pasting it
into a textbox - which I don't want to do.

If I paste it into a div in design view it removes all formatting. Same in
source view. If I put it into MS Word and save as plain html it puts all
sorts of gargage in it that doesn't work in VS.

Is there any program that will do this?

Thanks,
TPut the text into a <PRE>...</PREtag, which will hold on to the whitespace
formatting. You can put the PRE tag into a DIV tag if you want.

"Tina" <TinaMSeaburn@.nospamexcite.comwrote in message
news:OLc94tL5GHA.3376@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>I have a text file perfectly formatted with carriage returns, indents,
>spacing etc in NotePad. I want to put text that looks exactly like that
>into a <divand get it formatted exactly the same way in Visual Studio.
>But I can't seem to get this done in Visual Studio other than pasting it
>into a textbox - which I don't want to do.
>
If I paste it into a div in design view it removes all formatting. Same
in source view. If I put it into MS Word and save as plain html it puts
all sorts of gargage in it that doesn't work in VS.
>
Is there any program that will do this?
>
Thanks,
T
>


Well, that works pretty good. Thanks.
Is there a way to get the text to wrap inside the PRE or the DIV?
Thanks,
T

"Scott M." <s-mar@.nospam.nospamwrote in message
news:ulx$s1L5GHA.3452@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Put the text into a <PRE>...</PREtag, which will hold on to the
whitespace formatting. You can put the PRE tag into a DIV tag if you
want.
>
>
"Tina" <TinaMSeaburn@.nospamexcite.comwrote in message
news:OLc94tL5GHA.3376@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>>I have a text file perfectly formatted with carriage returns, indents,
>>spacing etc in NotePad. I want to put text that looks exactly like that
>>into a <divand get it formatted exactly the same way in Visual Studio.
>>But I can't seem to get this done in Visual Studio other than pasting it
>>into a textbox - which I don't want to do.
>>
>If I paste it into a div in design view it removes all formatting. Same
>in source view. If I put it into MS Word and save as plain html it puts
>all sorts of gargage in it that doesn't work in VS.
>>
>Is there any program that will do this?
>>
>Thanks,
>T
>>


>
>


Oh, I also notice that text inside the PRE will not follow CSS specified
fonts so it looks like
it acts just like text in a text box and these are the reasons I did not
want to use a textbox.
T

"Scott M." <s-mar@.nospam.nospamwrote in message
news:ulx$s1L5GHA.3452@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Put the text into a <PRE>...</PREtag, which will hold on to the
whitespace formatting. You can put the PRE tag into a DIV tag if you
want.
>
>
"Tina" <TinaMSeaburn@.nospamexcite.comwrote in message
news:OLc94tL5GHA.3376@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>>I have a text file perfectly formatted with carriage returns, indents,
>>spacing etc in NotePad. I want to put text that looks exactly like that
>>into a <divand get it formatted exactly the same way in Visual Studio.
>>But I can't seem to get this done in Visual Studio other than pasting it
>>into a textbox - which I don't want to do.
>>
>If I paste it into a div in design view it removes all formatting. Same
>in source view. If I put it into MS Word and save as plain html it puts
>all sorts of gargage in it that doesn't work in VS.
>>
>Is there any program that will do this?
>>
>Thanks,
>T
>>


>
>


Sorry, you can't have it both ways. Use PRE and WYSIWYG, no more and no
less - don't use PRE and all white space is stripped.

"Tina" <TinaMSeaburn@.nospamexcite.comwrote in message
news:OvyGZcO5GHA.3736@.TK2MSFTNGP02.phx.gbl...

Quote:

Originally Posted by

Well, that works pretty good. Thanks.
Is there a way to get the text to wrap inside the PRE or the DIV?
Thanks,
T
>
"Scott M." <s-mar@.nospam.nospamwrote in message
news:ulx$s1L5GHA.3452@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>Put the text into a <PRE>...</PREtag, which will hold on to the
>whitespace formatting. You can put the PRE tag into a DIV tag if you
>want.
>>
>>
>"Tina" <TinaMSeaburn@.nospamexcite.comwrote in message
>news:OLc94tL5GHA.3376@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>>>I have a text file perfectly formatted with carriage returns, indents,
>>>spacing etc in NotePad. I want to put text that looks exactly like that
>>>into a <divand get it formatted exactly the same way in Visual Studio.
>>>But I can't seem to get this done in Visual Studio other than pasting it
>>>into a textbox - which I don't want to do.
>>>
>>If I paste it into a div in design view it removes all formatting. Same
>>in source view. If I put it into MS Word and save as plain html it puts
>>all sorts of gargage in it that doesn't work in VS.
>>>
>>Is there any program that will do this?
>>>
>>Thanks,
>>T
>>>


>>
>>


>
>


Again, that's what PRE does - uses a monospaced font.

You've got to remember the language you are working in. HTML is a language
where whitespace stripping occurs. If you want to build space back in, you
could look into entities such as (which will get messy). You could
read your text file and parse that file into <P>, <BR and where you
read line breaks and spaces.

"Tina" <TinaMSeaburn@.nospamexcite.comwrote in message
news:eqS$4fO5GHA.1248@.TK2MSFTNGP03.phx.gbl...

Quote:

Originally Posted by

Oh, I also notice that text inside the PRE will not follow CSS specified
fonts so it looks like
it acts just like text in a text box and these are the reasons I did not
want to use a textbox.
T
>
"Scott M." <s-mar@.nospam.nospamwrote in message
news:ulx$s1L5GHA.3452@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>Put the text into a <PRE>...</PREtag, which will hold on to the
>whitespace formatting. You can put the PRE tag into a DIV tag if you
>want.
>>
>>
>"Tina" <TinaMSeaburn@.nospamexcite.comwrote in message
>news:OLc94tL5GHA.3376@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>>>I have a text file perfectly formatted with carriage returns, indents,
>>>spacing etc in NotePad. I want to put text that looks exactly like that
>>>into a <divand get it formatted exactly the same way in Visual Studio.
>>>But I can't seem to get this done in Visual Studio other than pasting it
>>>into a textbox - which I don't want to do.
>>>
>>If I paste it into a div in design view it removes all formatting. Same
>>in source view. If I put it into MS Word and save as plain html it puts
>>all sorts of gargage in it that doesn't work in VS.
>>>
>>Is there any program that will do this?
>>>
>>Thanks,
>>T
>>>


>>
>>


>
>


PRE
{
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}

Tina wrote:

Quote:

Originally Posted by

Well, that works pretty good. Thanks.
Is there a way to get the text to wrap inside the PRE or the DIV?
Thanks,
T
>
"Scott M." <s-mar@.nospam.nospamwrote in message
news:ulx$s1L5GHA.3452@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

Put the text into a <PRE>...</PREtag, which will hold on to the
whitespace formatting. You can put the PRE tag into a DIV tag if you
want.

"Tina" <TinaMSeaburn@.nospamexcite.comwrote in message
news:OLc94tL5GHA.3376@.TK2MSFTNGP05.phx.gbl...

Quote:

Originally Posted by

>I have a text file perfectly formatted with carriage returns, indents,
>spacing etc in NotePad. I want to put text that looks exactly like that
>into a <divand get it formatted exactly the same way in Visual Studio.
>But I can't seem to get this done in Visual Studio other than pasting it
>into a textbox - which I don't want to do.
>
If I paste it into a div in design view it removes all formatting. Same
in source view. If I put it into MS Word and save as plain html it puts
all sorts of gargage in it that doesn't work in VS.
>
Is there any program that will do this?
>
Thanks,
T
>


Thursday, March 22, 2012

textarea and scrollbar

Hi All,

in my application, I am using textarea html control to display large text. I have to make this as readonly, so I am setting its 'Disabled' property 'true'. My problem is when content to show is larger than the textarea it does not show vertical scroll bar. I am setting overflow property to auto also but no luck. can someone please help me ?.

Thanks,

Amit

Don't disable it, set it ReadOnly... you'll have to do some funky coding, probably with Javascript.

Otherwise, have you looked at any other controls? Like a multiline <asp:Textbox...> control?


If you are using an asp:textbox, you need to put in this attribute,

TextMode="MultiLine"

So it would be something like,

<asp:TextBox ID="TextBox1" TextMode="MultiLine" runat="server"></asp:TextBox>

Thanks Curt. It is working. I added following line in code behine and it works

this.txtArea.Attributes.Add("readonly","true");

textarea viewstate formatting

Hello.

What I am trying to do is implement a "preview" function that displays all of the html typed within a textarea onto a webpage with HTML intact. I am using the viewstate to preserve the contents of the textarea. However, I find that doing this replaces all "<" with "<", ">" with ">". As a result, the preview does not render any HTML.

It appears that viewstate with asp.net automatically converts the chars, perhaps as insurance to "sterilize" malicious script. Can someone confirm this?

Is there a way to prevent it from converting the carat characters for the viewState preservation? Or is it a fact of life that I'll need to manually convert them back?

Thanks,
walla118Thanks niceguy.

I just realized that HtmlDecode would work for my purposes. And your idea about using javascript to display preview might be a good way to go!

Thanks again.
Hi walla118,

Have you tried using:


HttpContext.Current.Server.HtmlEncode
HttpContext.Current.Server.HtmlDecode

These may help...?

I found that it is easier to open a pop-up using javascript for a "preview" rather than doing it server side...just a thought.

Hope this helps!

Jason

Textarea-control

Cross browser or IE specific ?

IE has a special mode that allows to expose a built-in HTML editor. Don't
know about others...

See
http://msdn.microsoft.com/library/d.../commandids.asp
for available commands...

Patrice

--

"Bart Schelkens" <bschelkens@dotnet.itags.org.hotmail.com> a crit dans le message de
news:OsORcNPGFHA.3792@dotnet.itags.org.TK2MSFTNGP10.phx.gbl...
> Hi,
> I'm looking for a control that allows a user to use buttons so he can put
> some html in his text.
> Something like the ones in the screen shot.
> Can anyone help me?
> Thanks in advance.Actually i was hoping to find one that is cross browser.

"Patrice" <nobody@.nowhere.com> schreef in bericht
news:OygdPGQGFHA.936@.TK2MSFTNGP12.phx.gbl...
> Cross browser or IE specific ?
> IE has a special mode that allows to expose a built-in HTML editor. Don't
> know about others...
> See
> http://msdn.microsoft.com/library/d.../commandids.asp
> for available commands...
> Patrice
> --
> "Bart Schelkens" <bschelkens@.hotmail.com> a crit dans le message de
> news:OsORcNPGFHA.3792@.TK2MSFTNGP10.phx.gbl...
>> Hi,
>>
>> I'm looking for a control that allows a user to use buttons so he can put
>> some html in his text.
>> Something like the ones in the screen shot.
>>
>> Can anyone help me?
>> Thanks in advance.
>>
>>
>>
Bart:
Just wanted to make sure you saw my link:
http://www.freetextbox.com/

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/

"Bart Schelkens" <bschelkens@.hotmail.com> wrote in message
news:e33thDRGFHA.1408@.TK2MSFTNGP10.phx.gbl...
> Actually i was hoping to find one that is cross browser.
> "Patrice" <nobody@.nowhere.com> schreef in bericht
> news:OygdPGQGFHA.936@.TK2MSFTNGP12.phx.gbl...
> > Cross browser or IE specific ?
> > IE has a special mode that allows to expose a built-in HTML editor.
Don't
> > know about others...
> > See
http://msdn.microsoft.com/library/d.../commandids.asp
> > for available commands...
> > Patrice
> > --
> > "Bart Schelkens" <bschelkens@.hotmail.com> a crit dans le message de
> > news:OsORcNPGFHA.3792@.TK2MSFTNGP10.phx.gbl...
> >> Hi,
> >>
> >> I'm looking for a control that allows a user to use buttons so he can
put
> >> some html in his text.
> >> Something like the ones in the screen shot.
> >>
> >> Can anyone help me?
> >> Thanks in advance.
> >>
> >>
> >>
Yes i did karl, thx
"Karl Seguin" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net>
schreef in bericht news:%234GrHPaGFHA.392@.TK2MSFTNGP14.phx.gbl...
> Bart:
> Just wanted to make sure you saw my link:
> http://www.freetextbox.com/
> karl
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
> "Bart Schelkens" <bschelkens@.hotmail.com> wrote in message
> news:e33thDRGFHA.1408@.TK2MSFTNGP10.phx.gbl...
>> Actually i was hoping to find one that is cross browser.
>>
>> "Patrice" <nobody@.nowhere.com> schreef in bericht
>> news:OygdPGQGFHA.936@.TK2MSFTNGP12.phx.gbl...
>> > Cross browser or IE specific ?
>>> > IE has a special mode that allows to expose a built-in HTML editor.
> Don't
>> > know about others...
>>> > See
>> http://msdn.microsoft.com/library/d.../commandids.asp
>> > for available commands...
>>> > Patrice
>>> > --
>>> > "Bart Schelkens" <bschelkens@.hotmail.com> a crit dans le message de
>> > news:OsORcNPGFHA.3792@.TK2MSFTNGP10.phx.gbl...
>> >> Hi,
>> >>
>> >> I'm looking for a control that allows a user to use buttons so he can
> put
>> >> some html in his text.
>> >> Something like the ones in the screen shot.
>> >>
>> >> Can anyone help me?
>> >> Thanks in advance.
>> >>
>> >>
>> >>
>>>>
>>