473,791 Members | 2,827 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asp:Imagebutton and javascript

JIM
Hello,

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

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

How can I set the visible propery to true using a javascript ?
I tried something like document.GetEle mentById('ImgTe st').visible='t rue';
but without succes ....

Any idea ?

Many thanks,

KArel
Nov 19 '05 #1
3 5163
"JIM" wrote in message news:QH******** ***********@bie bel.telenet-ops.be...
: I've an asp:Imagebutton on my form with the visible property set to false
:
: <asp:Imagebutto n ID="tstImage" runat=Server visible=False>
:
: How can I set the visible propery to true using a javascript ?
: I tried something like document.GetEle mentById('ImgTe st').visible='t rue';
: 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.GetEle mentById('ImgTe st').visible='t rue';
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:Imagebutto n ID="tstImage" runat=Server visible=False>

How can I set the visible propery to true using a javascript ?
I tried something like
document.GetEle mentById('ImgTe st').visible='t rue'; 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.publi c.inetserver.as p.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
6827
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 understand the differences between ASP JavaScript and ASP VBScript?? Because JavaScript is client-side technology, and ASP is server side technology. I think VBScript is used to implement ASP pages.
1
3299
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."+ JR.Core.Data.JobseekerData.FLD_SEARCH_ID) %>_<%# DataBinder.Eval(Container,"DataItem."+JR.Core.Data.JobseekerData.FLD_SEARCH_ PROFILE_ID ) %>' CommandName='ProfileMatch' id="match" onmouseover="this.src ='../Images/magnifyover.gif'"
1
1577
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 javascript ? I tried something like document.GetElementById('ImgTest').visible='true'; but without succes ....
1
3045
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" visible="False" />
1
2368
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. <asp:imagebutton id="Image1" Runat="server" onclick="enteraccount" height="90" width="120" ImageUrl="images/account.gif" />
5
1719
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 corresponding button click event is launched? Tnx.
13
7449
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" runat="server"></asp:imagebutton></A> When the user sees these buttons, they will currently be on the savings.aspx?category=whatever page, and when they click another button to look at other categories, all the links I have around these buttons direct to their various categories.
1
1282
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 one was pressed. How can I do this? I was trying with commandname and oncommand properties of ASP:ImageButton but I was not able to make this work.
4
2241
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 like it to display 5 records per page. i have looked at asp recordset paging on several sites, however cannot find any scripts that work with ASP JAVASCRIPT. can anyone help?????????????????????????
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5430
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.