Ask a Question related to ASP.NET General, Design and Development.
-
mg #1
Get text in TextBox without pressing Enter key
I want to enter characters in a TextBox in a WebForm,
press a Button in the WebForm, and read the characters
that were typed into the TextBox from within the
Button_Click event handler. The main point here is that I
want to read the value typed into the TextBox without
hitting the Enter key or setting focus on another
control ...
mg Guest
-
Pressing Enter screws up my template - line breaksimages
OK I am using a template. I have defined an editable region. When I press enter inside the region the navigation panel on left breaks apart. How can... -
input=text fires Submit when pressing Enter
Hello I have some textboxes (input type=Text) in a Form. In some Forms if I Press Enter while I am in the Textbox It causes a Submit. The... -
Textbox and button -- enter key/submit - REFERENCE
Hi, as you can see from my many posts the past few days, I have certainly been confused about the firing/non-firing of my textboxes and buttons. In... -
Textbox, button and Enter on keyboard
Question (using C# and ASP.NET), I have a textbox and a buttonClick on my asp.net page. I would like be able to hit the Enter button on the... -
why datagrid's itemcommand event fired when I press ENTER key in a TextBox
Hi, When you press the ENTER key the default button pressed and since the only button is the column template one a post back to the server... -
mg #2
Get text in TextBox without pressing Enter key
P.S. I need a C# solution. Thanks.
>-----Original Message-----
>I want to enter characters in a TextBox in a WebForm,
>press a Button in the WebForm, and read the characters
>that were typed into the TextBox from within the
>Button_Click event handler. The main point here is that I
>want to read the value typed into the TextBox without
>hitting the Enter key or setting focus on another
>control ...
>
>
>
>.
>mg Guest
-
dj Bass #3
Re: Get text in TextBox without pressing Enter key
double clicking on the button in the design view that you want to use will
provide you with the event handler you require, alternatively you can just
create a empty method which would look something like this:
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click
end sub.
then, say your edit box has the id = "editBoxText". You'll be able to call
the editBoxText.Text() method on that member variable created for that
control and access the text.
is that what you wanted or did i miss the boat?
if you want to set the focus from the submit button back to the edit box,
check out this website for a short method on setting focus...
[url]http://aspnetweblog.com/posts/7115.aspx[/url]
"mg" <mg@theworld.com> wrote in message
news:03e301c34a02$c5c555e0$a001280a@phx.gbl...> I want to enter characters in a TextBox in a WebForm,
> press a Button in the WebForm, and read the characters
> that were typed into the TextBox from within the
> Button_Click event handler. The main point here is that I
> want to read the value typed into the TextBox without
> hitting the Enter key or setting focus on another
> control ...
dj Bass Guest
-
S. Justin Gengo #4
Re: Get text in TextBox without pressing Enter key
mg,
Then the code that dj Bass just gave you is what you want.
You get the text with:
MyTextBox.Text
Justin
"mg" <mg@theworld.com> wrote in message
news:08b301c34a0a$a0993770$a301280a@phx.gbl...> I have an event handler for the button click event. What I
> need is [C#] code to place in this event handler. The code
> needs to read the characters in the TextBox without my
> having [physically] pressed the enter key after entering
> the characters in the TextBox or having given another
> control focus by pressing on it with the mouse.
>
>> want to use will> >-----Original Message-----
> >double clicking on the button in the design view that you> alternatively you can just> >provide you with the event handler you require,> this:> >create a empty method which would look something like> System.Object, ByVal e As> >
> >Private Sub btnSubmit_Click(ByVal sender As> You'll be able to call> >System.EventArgs) Handles btnSubmit.Click
> >
> >end sub.
> >
> >
> >then, say your edit box has the id = "editBoxText".> created for that> >the editBoxText.Text() method on that member variable> to the edit box,> >control and access the text.
> >
> >is that what you wanted or did i miss the boat?
> >
> >if you want to set the focus from the submit button back> focus...> >check out this website for a short method on setting> I> >
> >[url]http://aspnetweblog.com/posts/7115.aspx[/url]
> >
> >
> >"mg" <mg@theworld.com> wrote in message
> >news:03e301c34a02$c5c555e0$a001280a@phx.gbl...> >> I want to enter characters in a TextBox in a WebForm,
> >> press a Button in the WebForm, and read the characters
> >> that were typed into the TextBox from within the
> >> Button_Click event handler. The main point here is that> >> >> want to read the value typed into the TextBox without
> >> hitting the Enter key or setting focus on another
> >> control ...
> >
> >.
> >
S. Justin Gengo Guest
-
dj Bass #5
Re: Get text in TextBox without pressing Enter key
Unless you expect the event handler for a button to simply pick up the text
from the text box as you write? which wouldn't work, you'd need an event
handler for the text box on the text change event...
as they say in Zulu, angaas.
"S. Justin Gengo" <gengoj@krause.com> wrote in message
news:vh5cvsfi1n7a91@corp.supernews.com...> mg,
>
> Then the code that dj Bass just gave you is what you want.
>
> You get the text with:
>
> MyTextBox.Text
>
> Justin
>
>
> "mg" <mg@theworld.com> wrote in message
> news:08b301c34a0a$a0993770$a301280a@phx.gbl...>> > I have an event handler for the button click event. What I
> > need is [C#] code to place in this event handler. The code
> > needs to read the characters in the TextBox without my
> > having [physically] pressed the enter key after entering
> > the characters in the TextBox or having given another
> > control focus by pressing on it with the mouse.
> >
> >> > want to use will> > >-----Original Message-----
> > >double clicking on the button in the design view that you> > alternatively you can just> > >provide you with the event handler you require,> > this:> > >create a empty method which would look something like> > System.Object, ByVal e As> > >
> > >Private Sub btnSubmit_Click(ByVal sender As> > You'll be able to call> > >System.EventArgs) Handles btnSubmit.Click
> > >
> > >end sub.
> > >
> > >
> > >then, say your edit box has the id = "editBoxText".> > created for that> > >the editBoxText.Text() method on that member variable> > to the edit box,> > >control and access the text.
> > >
> > >is that what you wanted or did i miss the boat?
> > >
> > >if you want to set the focus from the submit button back> > focus...> > >check out this website for a short method on setting> > I> > >
> > >[url]http://aspnetweblog.com/posts/7115.aspx[/url]
> > >
> > >
> > >"mg" <mg@theworld.com> wrote in message
> > >news:03e301c34a02$c5c555e0$a001280a@phx.gbl...
> > >> I want to enter characters in a TextBox in a WebForm,
> > >> press a Button in the WebForm, and read the characters
> > >> that were typed into the TextBox from within the
> > >> Button_Click event handler. The main point here is that> > >> want to read the value typed into the TextBox without
> > >> hitting the Enter key or setting focus on another
> > >> control ...
> > >
> > >
> > >.
> > >
>
dj Bass Guest
-
Vikram.NET #6
Get text in TextBox without pressing Enter key
Hi,
It is not clear what you actually want to do.
You have said that after entering text in the textbox, you
will be pressing a Button in the web form. When you press
the button obviously, the textbox control will lose focus
and the Button will get focus.
As far as getting the text of the textbox is concerned, it
can be done very easily by writing the event handler for
Button's Click event as follows:
private void Button1_Click(object sender,
System.EventArgs e)
{
string Value;
Value = TextBox1.Text;
}
Value will contain the text entered in the textbox.
Regards,
Vikram
I>-----Original Message-----
>P.S. I need a C# solution. Thanks.
>
>>>-----Original Message-----
>>I want to enter characters in a TextBox in a WebForm,
>>press a Button in the WebForm, and read the characters
>>that were typed into the TextBox from within the
>>Button_Click event handler. The main point here is that>.>>want to read the value typed into the TextBox without
>>hitting the Enter key or setting focus on another
>>control ...
>>
>>
>>
>>.
>>
>Vikram.NET Guest



Reply With Quote

