<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Security</title><link>http://forums.asp.net/25.aspx</link><description>All about ASP.NET security (authentication, authorization, membership, roles, etc.) and the Login controls. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=24&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Setting enter key default button when login control and search button on same page!!!</title><link>http://forums.asp.net/thread/3304300.aspx</link><pubDate>Mon, 20 Jul 2009 17:34:54 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3304300</guid><dc:creator>Jenner_30</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/3304300.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=3304300</wfw:commentRss><description>&lt;p&gt;I&amp;#39;ve tried this (and a few other solutions found on the forums) but nothing seems to work for me. I have a loginview with a login control in the Anonymous Template, and have tried this Panel default button solution but my page&amp;#39;s default button remains my search button at the top. My code is identical to yours, except it&amp;#39;s wrapped in the template:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;pre name="code" class="xhtml"&gt;&amp;lt;AnonymousTemplate&amp;gt;&lt;br /&gt;&amp;lt;asp:Panel ID=&amp;quot;Panel1&amp;quot; runat=&amp;quot;server&amp;quot; DefaultButton=&amp;quot;Login1$LoginButton&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;asp:Login ID=&amp;quot;Login1&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/asp:Panel&amp;gt;&lt;br /&gt;&amp;lt;/AnonymousTemplate&amp;gt; &lt;br /&gt;&lt;/pre&gt;&lt;p&gt;I&amp;#39;ve also tried the Javascript method you linked to, but it doesn&amp;#39;t work for me either.&lt;br /&gt;Does anyone have a good solution to this?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Setting enter key default button when login control and search button on same page!!!</title><link>http://forums.asp.net/thread/1270880.aspx</link><pubDate>Fri, 28 Apr 2006 12:04:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1270880</guid><dc:creator>jminond</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1270880.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1270880</wfw:commentRss><description>&lt;p&gt;&lt;font size=2&gt;I found that in my runtime for somereason the loginbutton has that full text... so i needed to do &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size=2&gt;SetDefaultButton(l.ClientID + &lt;font color=#800000&gt;"_LoginButton"&lt;/font&gt;);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size=2&gt;Also, i modified the js to use getElementById as most people dont use name attributes anymore.&lt;/font&gt;&lt;/p&gt;</description></item><item><title>Re: Setting enter key default button when login control and search button on same page!!!</title><link>http://forums.asp.net/thread/1095266.aspx</link><pubDate>Thu, 27 Oct 2005 13:28:07 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1095266</guid><dc:creator>fischer</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1095266.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=1095266</wfw:commentRss><description>This works pretty good. Although I have one scenario when this doesn't work. &lt;br /&gt;&lt;br /&gt;I write wrong imput to the login and the validation control tells me I did wrong. I then type the right (or wrong) info and press enter again. This time the defaultbutton somehow was lost and the serchbutton (in my case an imagebutton) in master page is pressed instead.&lt;br /&gt;&lt;br /&gt;I have tryed many scenarios to find the error.. thought maybe had anything to do with client validation or something...</description></item><item><title>Re: Setting enter key default button when login control and search button on same page!!!</title><link>http://forums.asp.net/thread/979614.aspx</link><pubDate>Wed, 06 Jul 2005 17:14:21 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:979614</guid><dc:creator>farmas</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/979614.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=979614</wfw:commentRss><description>You could use the Panel solution proposed above by giving the UniqueId of the Login control submit button. For example, if the ID of the Login control is "Login1" then the panel would look like this:&lt;BR&gt;&lt;BR&gt;&amp;lt;asp:Panel ID="Panel1" runat="server" Height="50px" Width="125px" DefaultButton="&lt;STRONG&gt;Login1$LoginButton&lt;/STRONG&gt;"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Login ID="Login1" runat="server"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:Login&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/asp:Panel&amp;gt;&lt;BR&gt;&lt;BR&gt;If this doesn't suit your needs, you could set the default button by means of JavaScript. Take a look at post &lt;A HREF="/507628/ShowPost.aspx"&gt;http://forums.asp.net/507628/ShowPost.aspx&lt;/A&gt;&amp;nbsp;for sample code on how to do this.&lt;BR&gt;&lt;BR&gt;Hope it helps,&lt;BR&gt;- Federico</description></item><item><title>Re: Setting enter key default button when login control and search button on same page!!!</title><link>http://forums.asp.net/thread/977344.aspx</link><pubDate>Mon, 04 Jul 2005 21:20:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:977344</guid><dc:creator>jtoth55</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/977344.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=977344</wfw:commentRss><description>Does anyone else have any ideas about this?</description></item><item><title>Re: Setting enter key default button when login control and search button on same page!!!</title><link>http://forums.asp.net/thread/971908.aspx</link><pubDate>Wed, 29 Jun 2005 00:12:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:971908</guid><dc:creator>jtoth55</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/971908.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=971908</wfw:commentRss><description>Unfortunately, I do not just have button1 and button2. Like I said, I have a Login control, so I am not actually using a button (it is generated when the login control is converted to html.)</description></item><item><title>Re: Setting enter key default button when login control and search button on same page!!!</title><link>http://forums.asp.net/thread/971553.aspx</link><pubDate>Tue, 28 Jun 2005 17:25:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:971553</guid><dc:creator>Christopher Bowen</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/971553.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=971553</wfw:commentRss><description>Hi Justin,&lt;br&gt;
&lt;br&gt;
You could add a Panel control and set the DefaultButton
property to the control you wish to receive a click when enter is
pressed in one of the Panel's controls.&amp;nbsp; (In addition to Panels,
the Form itself also
supports a DefaultButton property.)&amp;nbsp; This way, you should be able
to "bucket" the controls to cause the correct button to click on enter
in each case.&lt;br&gt;
&lt;br&gt;
A related article - &lt;a href="http://weblogs.asp.net/skoganti/archive/2004/09/20/231695.aspx"&gt;http://weblogs.asp.net/skoganti/archive/2004/09/20/231695.aspx&lt;br&gt;
&lt;/a&gt;&lt;br&gt;Here's a simple Panel-based example (from: &lt;a href="http://www.developer.com/net/asp/article.php/10917_3506896_3"&gt;http://www.developer.com/net/asp/article.php/10917_3506896_3&lt;/a&gt;):&lt;br&gt;
&lt;font face="Courier New" size="3"&gt;
&lt;pre&gt;&amp;lt;html&amp;gt;&lt;br&gt;   &amp;lt;body&amp;gt;&lt;br&gt;      &amp;lt;form id="Form2" runat="server"&amp;gt;&lt;br&gt;         &amp;lt;asp:Panel ID="Panel1" &lt;b&gt;DefaultButton="Button1"&lt;/b&gt; RunAt="server"&amp;gt;&lt;br&gt;            &amp;lt;asp:Button ID="Button1" RunAt="server"/&amp;gt;&lt;br&gt;         &amp;lt;/asp:Panel&amp;gt;&lt;br&gt;         &amp;lt;asp:Panel ID="Panel2" &lt;b&gt;DefaultButton="Button2"&lt;/b&gt; RunAt="server"&amp;gt;&lt;br&gt;           &amp;lt;asp:Button ID="Button2" RunAt="server"/&amp;gt;&lt;br&gt;         &amp;lt;/asp:Panel&amp;gt;&lt;br&gt;      &amp;lt;/form&amp;gt;&lt;br&gt;   &amp;lt;/body&amp;gt;&lt;br&gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;/font&gt;&lt;br&gt;
Hope this helps!&lt;br&gt;
-Chris&lt;br&gt;
&lt;br&gt;</description></item><item><title>Setting enter key default button when login control and search button on same page!!!</title><link>http://forums.asp.net/thread/968518.aspx</link><pubDate>Sat, 25 Jun 2005 01:18:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:968518</guid><dc:creator>jtoth55</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/968518.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=968518</wfw:commentRss><description>I have a login control... The default behavior is that if a user enters in their user name and password and then hit enter (rather than clicking the button), it doesn't trigger the login button but triggers my search button on the top of the page instead.&lt;BR&gt;&lt;BR&gt;How can I remedy this problem?</description></item></channel></rss>