0

The intent is to append the javascript code within the OnClientClick event to pass in the value of SearchIDTextbox as the ID parameter. If I hard code "22" for ???? the function runs properly. I thinK I need to make ???? a single value bind expression but I'm having trouble setting up the code.

<asp:ImageButton ID="PremiumUserImageButton" Width="40px" OnClientClick="return clientClickEvent('AdvancedSearch.aspx?ID= ???? )" CausesValidation="False" ImageUrl="~/Images/Premium.gif" runat="server" />

Tried This no luck!

<asp:ImageButton ID="PremiumUserImageButton"  Width="40px" OnClientClick="return clientClickEvent('AdvancedSearch.aspx?ID='<%# GetID() %>'" CausesValidation="False" ImageUrl="~/Images/Premium.gif" runat="server" />
MSTdev
  • 4,507
  • 2
  • 23
  • 40
Bob Barbara
  • 45
  • 1
  • 5
  • need to first get the value of `searchTextbox` by `document.getelementbyid` method in javascript and assign it to the function as parameter. – Rahul May 20 '13 at 04:49

1 Answers1

0

In your code you have put extra apostrophe. As well as there is no any bracket close for the javascript function.

Please replace your code with below code.

<asp:ImageButton ID="PremiumUserImageButton"  Width="40px" OnClientClick="return clientClickEvent('AdvancedSearch.aspx?ID=<%# GetID() %>');" CausesValidation="False" ImageUrl="~/Images/Premium.gif" runat="server" />

You can also check this tag in firebug which is firefox best Add on.

Hope this will help you.

Mayur Desai
  • 683
  • 5
  • 13