Reason for my vote of 5
Excellent tip! It solved my problem, having a search button control put in a content template. I enveloped the button along with the search textbox with the div clause, and it works perfectly.
Reason for my vote of 1
For the reasons mentioned in my message (and comment).
I have waited for long but you have failed to give an explanation for the issue.
I was going to reply when I formatted the tip but the site went down just after that.
This tip/trick of yours won't work. You haven't defined WebForm_FireDefaultButton() function anywhere in your code.
And AFAIK, this javascript function is created by ASP.NET engine ONLY when you there is a DefaultButton property assigned to an asp Panel control.
The simplest way to achieve this is to assign a default button to the form.
This solution is for the case that you don't want to add a server side panel to your page just to fire the default button for you.
you are right about the script, at least one "defaultbutton" property must be set in a asp control for ASP.NET to include the function in the page source, and that's a minus point.
This solution is for the case that you don't want to add a server side panel to your page just to fire the default button for you.
The form tag itself has DefaultButton property. What's the point writing a block of code to do the same?
Bahram Ettehadieh wrote:
you are right about the script, at least one "defaultbutton" property must be set in a asp control for ASP.NET to include the function in the page source, and that's a minus point.
Not just any control, it MUST be an asp:panel control. So as you mentioned this is the negative point. And to work around the negative point, you need to add a Panel control with default button property. And hence it contradicts the very purpose of your tip (as mentioned in the first line of this post).
..Go Green..
Last Visit: 31-Dec-99 18:00 Last Update: 25-Sep-24 8:40