Showing posts with label character. Show all posts
Showing posts with label character. Show all posts

Thursday, March 29, 2012

Newbie: Javascript help

What js code is required to automatically submit a page to the server when a
user enters a given character (say "?") into a textbox server control please?

Thank youIn the .aspx page (did not check it running):

<head>
...
function checkKey(){
if (window.event.keyCode==63)
myForm.submit();
else
return true;
}
...
</head>
<body>
<form id=myForm ...?>
...
<asp:textbox ... onkeypress="return checkKey();" ... />
...
</form></body
Eliyahu

"MikeH" <MikeH@.community.nospam> wrote in message
news:BE91A000-8D92-448E-9B03-CC531DF85F8D@.microsoft.com...
> What js code is required to automatically submit a page to the server when
a
> user enters a given character (say "?") into a textbox server control
please?
> Thank you

Thursday, March 22, 2012

newline character - easy question

A Stupidly easy question - what is the newline character for VB.NET?

I have tried:
label.text = "first line \n second line"
and it doesnt work.

JagsYou could use VBCrlf or Environment.NewLine
If you want value in labe to come in next line then you have to use

"first line <br> second line"

[VBCrlf or NewLine dosn't work in HTML. So you have to use <br>]

hope it helps!
The VBCrlf was the one I wanted. Just wondering if I could put that into a sctring, i.e. instead of writing

label.text = "The is the first " & VBCrlf & "This is the second"

I could write something like

label.text = "This is the first \VBCrlf This is the second"
You can't do as below

label.text = "This is the first \VBCrlf This is the second" as it treates as a word in the string!

Friday, March 16, 2012

newline within a string

How can I insert a new line character (\n?) within a string in C#, so that when I display the string in some text box the string is displayed in multiple linesHi,

you can use System.Envirnment.NewLine() method to insert newline. Also if you are using Multiline textbox then I think you need to do something like this:


string AllText = TextBox1.Text.Replace(System.Envirnment.NewLine(),"<BR>");


What I am trying to do is

string strnewline;
TextBox1.text=strnewline;

Now I want to define the strnewline such that
TextBox1.text=strnewline;

displays the text in multiple lines. TextBox1 is multilined.

In short, is there any alternative to C-lang "/n " ?
check the code that I gave you it works !!!!