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 304645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:17:59+00:00 2026-05-12T07:17:59+00:00

I got an asp:Image in my server-markup like this: <asp:Image ID=Img1 runat=server/> Now, I

  • 0

I got an asp:Image in my server-markup like this:

<asp:Image ID="Img1" runat="server"/>

Now, I want to find this img in my javascript, but seem to run into the problem of ASP.Net obfuscating my names. The client-markup will look something like this:

<img id="ctl00_Content_Img1"/>

I imagine this is because everything is inside a form-element called ‘Content’, which is quite normal I guess? 🙂

Any pointers on how to access this from javascript?

[EDIT] I was thinking if there’s an easy way to change my javascript “servertime” to search for the obfuscated id ?

  • 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-12T07:17:59+00:00Added an answer on May 12, 2026 at 7:17 am

    Here you can get a server control’s client side id by using it’s ClientID property like that :

    <script>
    var imgID = '<%= Img1.ClientID %>';
    var imgObject = document.getElementById(imgID);
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got an asp:Image. I want this control to display, only if <%#Eval(Image)%> is
I got a ASP.NET MVC controller like this [Authorize] public class ObjectController : Controller
I want to show image in the dropdown using asp.net c#, I got the
I've got the following code: <span style=margin:0px 2px 0px 2px;> <asp:Label ID=labelPromptText runat=server Text=Selected
I have a Image button defined as follow, <div> <asp:ImageButton ID=btn1 runat=server ImageUrl=/_LAYOUTS/1033/IMAGES/row.png />
I got a asp site hosted in a iis server. In the server there
I've got this ASP.NET 2.0 website project in Visual Studio that I've been working
I finally got my site to work on my server, and it is now
Scenario I have got this form: <form action=EditShippingInfo.asp method=POST id=frmShippingInfo> <!-- stuff --> <input
I've got an asp:FileUpload control to upload images to my server, which is local.

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.