when enter key pressed then event has to be fired
i have chat application...when click on send button as well as Enter key then message is going to send...for send button event generated ....but what about enter key ..please help me
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Jun 25, 2013, 8:01 AM
Please use like below in your aspx page
Let me know if you need more details
Regards,
Iftikar
Remember to click "Mark as Answer" on the post, if it helps you.
Sunny SharmaPosted Jun 21, 2013, 10:06 PM
Sorry to respond you a little late. The problem that I can see in your page is that you're not grabbing the Text Editor properly. Do like this inside your script block:
--------------------------------------------------------------
---------------------------------------------------------------------
Hope this helps!
Cheers!
yadagiri uppariPosted Jun 21, 2013, 6:48 AM
yadagiri uppariPosted Jun 21, 2013, 6:08 AM
yadagiri uppariPosted Jun 21, 2013, 6:06 AM
aspx:
Sunny SharmaPosted Jun 21, 2013, 5:34 AM
sorry to ask you but It's really a bit annoying navigating through all these code with so many commented lines. Suggest you to share your project in whole or slice the relevant part only.
yadagiri uppariPosted Jun 21, 2013, 4:09 AM
I need your help sir
yadagiri uppariPosted Jun 21, 2013, 3:22 AM
yadagiri uppariPosted Jun 21, 2013, 3:19 AM
yadagiri uppariPosted Jun 21, 2013, 3:19 AM
Sunny SharmaPosted Jun 21, 2013, 3:03 AM
show me your aspx page code, I'll help you with that.
yadagiri uppariPosted Jun 21, 2013, 2:59 AM
i tried with all onkeyup,onkeypress,onkeydown....but still it is not working
Sanjeeb LenkaPosted Jun 21, 2013, 2:14 AM
now on page load write these code
protected void Page_Load(object sender, EventArgs e)
{
ClientScript.RegisterClientScriptBlock(this.GetType(), "Shortcut", "document.attachEvent ('onkeyup',ShortcutKeys);", true);
}
and check if any problem reply i will provide sample
yadagiri uppariPosted Jun 21, 2013, 1:49 AM
after typing some text in richtext box then message will be sent by clicking send button or enter key.....my app is in asp.net sir what should i do please help me...send button is working properly but enter key is not working
Pankaj PandeyPosted Jun 21, 2013, 1:37 AM
if (e.KeyCode == Keys.Enter)
{
//just copy and paste the code that you written on send button event.
}
yadagiri uppariPosted Jun 21, 2013, 12:44 AM
as performClick() not found........pls help me
Sunny SharmaPosted Jun 20, 2013, 12:28 PM
Use the pattern below:
--------------------------------------------
private void ChatWindow_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
btnSendMessage.PerformClick();
}
}
--------------------------------------------
Mark as answer if it helps.
Cheers!