| | |
ASP.NET Panel DefaultButton not working
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2009
Posts: 5
Reputation:
Solved Threads: 0
On this test page I intend that if you press the Enter key with focus in TextBox1, Button1_Click will fire, whereas in TextBox2, Button2_Click will fire. This is not working in IE8 or FF3.5. Any ideas?
ASP.NET Syntax (Toggle Plain Text)
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Test Page</title> <meta name="ROBOTS" content="NOINDEX" /> </head> <body> <form id="form1" runat="server"> <asp:Panel ID="Panel1" DefaultButton="Button1" runat="server"> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Button1" onclick="Button1_Click" /> </asp:Panel> <asp:Panel ID="Panel2" DefaultButton="Button2" runat="server"> <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> <asp:Button ID="Button2" runat="server" Text="Button2" onclick="Button2_Click" /> </asp:Panel> <asp:Label ID="Label1" runat="server" Text="Label1"></asp:Label> </form> </body> </html>
•
•
Join Date: Jul 2009
Posts: 5
Reputation:
Solved Threads: 0
Thanks for looking into this. Could you send me a link to the page that works, or paste its HTML output and HTTP headers here?
•
•
Join Date: Jun 2009
Posts: 446
Reputation:
Solved Threads: 82
This is the HTML source viewed in my IE8. The same is viewed in http://www.oxonacf.org.uk/test.aspx also.
ASP.NET Syntax (Toggle Plain Text)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1"><title> Test Page </title><meta name="ROBOTS" content="NOINDEX" /></head> <body> <form name="form1" method="post" action="TestPage11.aspx" id="form1"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTA4OTU2ODYyMw9kFgICAw9kFgICBQ8PFgIeBFRleHQFK0J1dHRvbjFfQ2xpY2sgZmlyZWQgYXQgNy83LzIwMDkgMTA6MDQ6NDcgUE1kZGRpowb0CyldCDBRuX+q0ABj19Zgog==" /> </div> <div> <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWBQK/x8UUAuzRsusGAoznisYGAuzR9tkMArursYYI6vzYosbpPS4bH3+PLel4Gwkqpdo=" /> </div> <div id="Panel1" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'Button1')"> <input name="TextBox1" type="text" id="TextBox1" /> <input type="submit" name="Button1" value="Button1" id="Button1" /> </div> <div id="Panel2" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'Button2')"> <input name="TextBox2" type="text" id="TextBox2" /> <input type="submit" name="Button2" value="Button2" id="Button2" /> </div> <span id="Label1">Button1_Click fired at 7/7/2009 10:04:47 PM</span> <script type="text/javascript"> //<![CDATA[ var theForm = document.forms['form1']; if (!theForm) { theForm = document.form1; } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]> </script> <script src="/Site3/WebResource.axd?d=a89fGCglRfUbEVx19IXx7g2&t=633658105131718750" type="text/javascript"></script> </form> </body> </html>
Last edited by Ramesh S; Jul 7th, 2009 at 1:36 pm.
•
•
Join Date: Jul 2009
Posts: 5
Reputation:
Solved Threads: 0
Oh damn I've got it, and it's not good. Since implementing ASP.NET Routing the application is no longer returning requests for WebResource.axd.
I've got
Any ideas?
I've got
routes.Add(new Route("{resource}.axd/{*pathInfo}", new StopRoutingHandler())); in Application_Start but it's not doing the trick. And an error is thrown if I remove the trailing slash after .axd.Any ideas?
![]() |
Similar Threads
- Looking for Sr. ASP .NET Developers (Software Development Job Offers)
- ASP.NET/SQL Developer/Programmer (Web Development Job Offers)
- ASP.Net perm full time programmer wanted (Web Development Job Offers)
- Front-End Developer with ASP.net needed!!! (Web Development Job Offers)
- Experience ASP.net with C# developer needed!! (Web Development Job Offers)
- ASP.Net / C# Web Developer (Web Development Job Offers)
Other Threads in the ASP.NET Forum
- Previous Thread: windows authenticaiton (AD), network file access
- Next Thread: Message doesn't work:-
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.net 2.0 activexcontrol advice ajax alltypeofvideos anathor application asp asp.net bc30451 bottomasp.net box browser button c# checkbox click commonfunctions confirmationcodegeneration css dataaccesslayer database datagridview datagridviewcheckbox datalist deadlock development dgv dropdownlist dynamically edit expose feedback fileuploader fill flash form formatdecimal forms formview google grid gridview gudi iframe iis javascript list listbox login microsoft mono mouse mssql multistepregistration news numerical objects opera panelmasterpagebuttoncontrols parent project radio redirect registration relationaldatabases reportemail richtextbox rotatepage save schoolproject search security select silverlight smartcard smoobjects software sql-server sqlserver2005 suse textbox tracking unauthorized validation vb.net video videos view virtualdirectory vista visualstudio web webapplications webdevelopemnt webprogramming webservice xsl youareanotmemberofthedebuggerusers





