Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7077959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:29:15+00:00 2026-05-28T06:29:15+00:00

Can anyone offer an explanation as to why the asp:imagebutton gives me a badly

  • 0

Can anyone offer an explanation as to why the asp:imagebutton gives me a badly formed html error while the html input element does not? I know it’s about the findcontrol() in the onclientclick
assignment. They’re written in exactly the same format but maybe they shouldn’t be?

 <ItemTemplate>
     <input type="image" src="Resources/info.png"         onclick="toggle('<%# Container.FindControl("PresetUploadDescription").ClientID %>');return false;" /> 
     <asp:ImageButton ImageUrl="Resources/info.png" OnClientClick="toggle('<%# Container.FindControl("PresetUploadDescription").ClientID %>');return false;" ToolTip="info" ID="Description" runat="server"/>
.... 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:29:16+00:00Added an answer on May 28, 2026 at 6:29 am

    You cannot use a <%…%> construct in a control that is executed at the server. (runat=”server”)

    <%#…%> is used for databinding or Eval type statements.

    <%=…%> is equivalent to a Response.Write statement, which looks like what you are trying to do (write out the ClientID of a certain control). Unfortunately, this won’t work either – you’ll get a

    Server tags cannot contain <% … %> constructs. Error

    To fix, you need to Add the OnClientClick attribute to the Imagebutton control via the Code Behind page:

    Description.Attributes.Add("OnClientClick", 
    "toggle('" + FindControl("PresetUploadDescription").ClientID + "');return false;");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am receiving this error when trying to use RedirectToAction, can anyone offer any
Can anyone offer suggestions for the logic in a MySQL query that does the
Can anyone offer an alternative to removing duplicates from an numeric indexed table that
can anyone offer a selector to do away with this horrible chunk of code:
Can anyone suggest a CMS able to offer the following features: Free/open source Support
Can anyone suggest the best way to offer a file for download within a
Can anyone offer a clue as to why flashdevelop would compile to a smaller
Can anyone offer any VBA macro suggestions? In a Word doc table, I need
Hi can anyone offer some help please ? I have two images on my
I've just been tasked with finding automated actionscript frameworks. Can anyone offer the best

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.