473,403 Members | 2,338 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Asp:Imagebutton and javascript

JIM
Hello,

I've an asp:Imagebutton on my form with the visible property set to false

<asp:Imagebutton ID="tstImage" runat=Server visible=False>

How can I set the visible propery to true using a javascript ?
I tried something like document.GetElementById('ImgTest').visible='true';
but without succes ....

Any idea ?

Many thanks,

KArel
Nov 19 '05 #1
3 5147
"JIM" wrote in message news:QH*******************@biebel.telenet-ops.be...
: I've an asp:Imagebutton on my form with the visible property set to false
:
: <asp:Imagebutton ID="tstImage" runat=Server visible=False>
:
: How can I set the visible propery to true using a javascript ?
: I tried something like document.GetElementById('ImgTest').visible='true';
: but without succes ....
:
: Any idea ?

Jim...

Isn't that an ASP.NET image button? This is Classic ASP. NG replies
updated.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp
Nov 19 '05 #2
> How can I set the visible propery to true using a javascript ?
I tried something like document.GetElementById('ImgTest').visible='true';
but without succes ....


You can't. If you're setting the visibility on the control, then that's
being controlled by the codebehind. If it's set to be visible="false" it
won't even be rendered in the HTML.

For what you want, I think you want to place the button in a DIV and then
HIDE the div via javascript when the page loads. That way it's part of the
DOM and you can then do what you want with it via javascript.

-Darrel
Nov 19 '05 #3
JIM wrote:
Hello,

I've an asp:Imagebutton on my form with the visible property set to
false

<asp:Imagebutton ID="tstImage" runat=Server visible=False>

How can I set the visible propery to true using a javascript ?
I tried something like
document.GetElementById('ImgTest').visible='true'; but without succes
....

You can't. When its visible property is set to false, it is not rendered in
the client, so there is nothing there on which the clientside code can act.

What you have to do is set its visible property to true. That way there will
be an html element in the client DOM on which client-side code can act.
You can set its display style to none in the body onload event. You can set
it to inline or block in whatever event you are thinking of using to set it
to visible.
Bob Barrows
PS. microsoft.public.inetserver.asp.general is for classic ASP questions. I
have removed that group from the crosspost.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Davis | last post by:
When I create new documents in Dreamweaver, there are several choices for ASP creation: ASP JavaScript: run at client side?? ASP VBScript: run at server side?? ASP.NET C# ASP.NET VB I don't...
1
by: Darren Clark | last post by:
I need to be able to send through 2 peices of infomraiton in the commandArgument property of a image button... <asp:imagebutton CommandArgument='<%# DataBinder.Eval(Container,"DataItem."+...
1
by: JIM | last post by:
Hello, I've an asp:Imagebutton on my form with the visible property set to false <asp:Imagebutton ID="tstImage" runat=Server visible=False> How can I set the visible propery to true using a...
1
by: JIM | last post by:
Hello, Does anyone knows how to set the visible property of an asp:Imagebutton to true with javascript I've the following declared : <asp:ImageButton Id="tstImage" runat="server"...
1
by: Michael Evanchik | last post by:
The following tag works fine in internet explorer, but in mozilla the image is not sized and left at its actualy size. Anyone know why? I though asp.net works on any browswer. ...
5
by: Alex D. | last post by:
Does any body knows how to link an asp:textbox to an asp:imagebutton, both inside a User Control in asp.net 2 beta 2? So when a user enter some text in the textbox and press the "Enter" key the...
13
by: tperri | last post by:
I have an HTML table with several fields like this: <A href="Savings.aspx?category=Food"><asp:imagebutton id="imgFood" ImageUrl="images\buttons\btn-food-i.gif"...
1
by: Shapper | last post by:
Hello, I have 2 Asp:ImageButton in my .aspx file and I have the function "Run" in m .aspx.vb file. I need to run this function when one of the ImageButtons is pressed but I need to know which...
4
by: zfarooq01 | last post by:
Asp Javascript language paging larger database record sets i am firmiliar with asp javascript and not asp VB. i can display the results ok, but if i return 100 records from my table i would...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.