.NETGURU
enter key hell problem 2
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.aspnet.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

gh0st54
Hi me again

problem 2

on pages that have no user controls i want to submit using the enter key

i register
Page.RegisterHiddenField("__EVENTTARGET", "btnSubmit");

when i press enter it doesn't fire

what am i missing ???
Reply to this message...
 
    
Steve C. Orr [MVP, MCSD] (VIP)
You can intercept the client side enter keypress event of the text box and
then do what you want using javascript code.
Here's a good example:
http://www.kamp-hansen.dk/pages/showdoc.asp?id=28&menuid=21&menuid=18

You could also try using this free control.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here's a couple good articles on the subject:
http://www.allasp.net/enterkey.aspx
http://www.aspnetpro.com/features/2004/06/asp200406so_f/asp200406so_f.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net

"gh0st54" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Dot Net Guru Berther
Hello Click here to reveal e-mail address,

I've had a post that discusses how to accomplish this on my website:

http://www.mattberther.com/2003/06/000125.html

--
Dot Net Guru Berther
http://www.mattberther.com

[Original message clipped]

Reply to this message...
 
    
gh0st54
Sorry
I tried it but doesn't work

i'm being sent back to index.aspx ??? weird

so what i do know is

if(!Page.IsPostBack)
            {
bla bla bla .....
                Page.RegisterHiddenField("__EVENTTARGET","submit" );

                this.txtSendTo.Attributes.Add("onFocus","javascript:SetTarget('submit');");
                this.txtSubject.Attributes.Add("onFocus","javascript:SetTarget('submit');");
                this.txtMessage.Attributes.Add("onFocus","javascript:SetTarget('notsubmit');");
            }

            if(Page.IsPostBack){
                if(Page.Request.Form["__EVENTTARGET"].ToString().ToLower()=="submit"){
                    this.Send();
                }
            }

I know it's ugly but it works.

there has to be something not that ugly

Dot Net Guru Berther <Click here to reveal e-mail address> wrote in message news:<Click here to reveal e-mail address>...
[Original message clipped]

Reply to this message...
 
    
Girish bharadwaj
have you checked out Scott's blog here:
http://www.hanselman.com/blog/PermaLink.aspx?guid=3f96f2ee-331f-480a-81af-dd62c8f92c23

That covers a few of them.

--
Girish Bharadwaj
http://msmvps.com/gbvb
"gh0st54" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

");
[Original message clipped]

Reply to this message...
 
    
Alvin Bruney [MVP]
start here
http://www.allasp.net/enterkey.aspx

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"gh0st54" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.Web.UI.Page




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification