473,396 Members | 2,010 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,396 software developers and data experts.

How to enable imagebutton from another frame

Rod
Hi!
I have 2 frames called "Left" and "Main".
In the "main" I have this imagebutton (the enabled property is set to
"False"):

<form id="Form1" method="post" runat="server">
<asp:imagebutton id="ImgBtProdotti" runat="server"
imageurl="/image.jpg"></asp:imagebutton>
</form>

In the frame "Left" I have a butto and on the "click" event I want to
"enable" the "ImgBtProdotti".
I wrote :

s = "<script language='javascript'>" & vbCrLf & "<!--" & vbCrLf &
"window.parent.frames['Main'].document.all('ImgBtProdotti').enabled = True;"
& vbCrLf & "//-->" & vbCrLf & "</script>"
Response.Write(s)

But It doesn't work. The error is : True is not defined.

Could anyone help me ?

Nov 19 '05 #1
4 1242
javascript is case senstive, use "true";

-- bruce (sqlwork.com)

"Rod" <ca**********@tiscali.it> wrote in message
news:uG**************@TK2MSFTNGP15.phx.gbl...
Hi!
I have 2 frames called "Left" and "Main".
In the "main" I have this imagebutton (the enabled property is set to
"False"):

<form id="Form1" method="post" runat="server">
<asp:imagebutton id="ImgBtProdotti" runat="server"
imageurl="/image.jpg"></asp:imagebutton>
</form>

In the frame "Left" I have a butto and on the "click" event I want to
"enable" the "ImgBtProdotti".
I wrote :

s = "<script language='javascript'>" & vbCrLf & "<!--" & vbCrLf &
"window.parent.frames['Main'].document.all('ImgBtProdotti').enabled =
True;"
& vbCrLf & "//-->" & vbCrLf & "</script>"
Response.Write(s)

But It doesn't work. The error is : True is not defined.

Could anyone help me ?

Nov 19 '05 #2
"Rod" <ca**********@tiscali.it> wrote in message
news:uG**************@TK2MSFTNGP15.phx.gbl...
Hi!
I have 2 frames called "Left" and "Main".
In the "main" I have this imagebutton (the enabled property is set to
"False"):

<form id="Form1" method="post" runat="server">
<asp:imagebutton id="ImgBtProdotti" runat="server"
imageurl="/image.jpg"></asp:imagebutton>
</form>

In the frame "Left" I have a butto and on the "click" event I want to
"enable" the "ImgBtProdotti".
I wrote :

s = "<script language='javascript'>" & vbCrLf & "<!--" & vbCrLf &
"window.parent.frames['Main'].document.all('ImgBtProdotti').enabled =
True;"
& vbCrLf & "//-->" & vbCrLf & "</script>"
Response.Write(s)

But It doesn't work. The error is : True is not defined.

Could anyone help me ?


I think HTML elements have a "disabled" property and not a "enabled"
property. And javascript is also case sensitive. So try to write this
instead:
window.parent.frames['Main'].document.all('ImgBtProdotti').disabled = false

See this link for reference:
http://msdn.microsoft.com/workshop/a...disabled_2.asp

And you should use "document.getElementById(.....)" instead of
"document.all(....)"

Marius
Nov 19 '05 #3
Rod
Thanks.
Using "....disabled" all it's all right.

A question: what is the difference using "...document.getelementbyid('...')
or ...document.all('..) ?

"Marius Tennes Krogh" <ma***@online.no> ha scritto nel messaggio
news:Oq**************@TK2MSFTNGP10.phx.gbl...
"Rod" <ca**********@tiscali.it> wrote in message
news:uG**************@TK2MSFTNGP15.phx.gbl...
Hi!
I have 2 frames called "Left" and "Main".
In the "main" I have this imagebutton (the enabled property is set to
"False"):

<form id="Form1" method="post" runat="server">
<asp:imagebutton id="ImgBtProdotti" runat="server"
imageurl="/image.jpg"></asp:imagebutton>
</form>

In the frame "Left" I have a butto and on the "click" event I want to
"enable" the "ImgBtProdotti".
I wrote :

s = "<script language='javascript'>" & vbCrLf & "<!--" & vbCrLf &
"window.parent.frames['Main'].document.all('ImgBtProdotti').enabled =
True;"
& vbCrLf & "//-->" & vbCrLf & "</script>"
Response.Write(s)

But It doesn't work. The error is : True is not defined.

Could anyone help me ?


I think HTML elements have a "disabled" property and not a "enabled"
property. And javascript is also case sensitive. So try to write this
instead:
window.parent.frames['Main'].document.all('ImgBtProdotti').disabled =
false

See this link for reference:
http://msdn.microsoft.com/workshop/a...disabled_2.asp

And you should use "document.getElementById(.....)" instead of
"document.all(....)"

Marius

Nov 19 '05 #4
"document.all(...)" is not specified in W3C's DOM (Document Object Model),
where as "document.getElementById(...)" is. In other words -
"document.getElementById(...)" is standard, "document.all(...)" is not.

http://www.quirksmode.org/js/dom.html
http://www.w3.org/TR/2000/WD-DOM-Lev...ml#ID-36113835

Marius
"Rod" <ca**********@tiscali.it> wrote in message
news:%2***************@TK2MSFTNGP15.phx.gbl...
Thanks.
Using "....disabled" all it's all right.

A question: what is the difference using
"...document.getelementbyid('...') or ...document.all('..) ?

"Marius Tennes Krogh" <ma***@online.no> ha scritto nel messaggio
news:Oq**************@TK2MSFTNGP10.phx.gbl...
"Rod" <ca**********@tiscali.it> wrote in message
news:uG**************@TK2MSFTNGP15.phx.gbl...
Hi!
I have 2 frames called "Left" and "Main".
In the "main" I have this imagebutton (the enabled property is set to
"False"):

<form id="Form1" method="post" runat="server">
<asp:imagebutton id="ImgBtProdotti" runat="server"
imageurl="/image.jpg"></asp:imagebutton>
</form>

In the frame "Left" I have a butto and on the "click" event I want to
"enable" the "ImgBtProdotti".
I wrote :

s = "<script language='javascript'>" & vbCrLf & "<!--" & vbCrLf &
"window.parent.frames['Main'].document.all('ImgBtProdotti').enabled =
True;"
& vbCrLf & "//-->" & vbCrLf & "</script>"
Response.Write(s)

But It doesn't work. The error is : True is not defined.

Could anyone help me ?


I think HTML elements have a "disabled" property and not a "enabled"
property. And javascript is also case sensitive. So try to write this
instead:
window.parent.frames['Main'].document.all('ImgBtProdotti').disabled =
false

See this link for reference:
http://msdn.microsoft.com/workshop/a...disabled_2.asp

And you should use "document.getElementById(.....)" instead of
"document.all(....)"

Marius


Nov 19 '05 #5

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

Similar topics

0
by: Andrés Giraldo | last post by:
Hi! I created a webcontrol that inherits from an ImageButton, I need to show the Enable property on the PropertyBox, how can I do that? Note: The ImageButton doesn't shows the Enable property...
9
by: Susan Bricker | last post by:
Hi. I have two questions ... (1) I want to use a Listbox to enable the user to select 1 or many items from the list. However, I'm having trouble figuring out how to find out t which items have...
1
by: Tee | last post by:
Hi, I have a server control Table with each row will contain a dynamic created ImageButton. And I have a private sub with the proper delegate of an ImageButton click which handle nothing....
0
by: Bruce W.1 | last post by:
I'm trying to put together a horizontal tab nav in a User Control, and I want to have some mouseOver behavior. This could easily be done with just CSS, however hyperlinking this way (client-side)...
1
by: Henke | last post by:
Hello, I have one ImageButton controls which I initialize in Page_Load and declare on class level. ImageButton save = new ImageButton(); save.ImageUrl = "save.gif" save.Click += new...
0
by: Oddball | last post by:
I have set up a page with uses two lots of image buttons, one for a collection and one for more images from that collection. I generate all the image buttons on page init (I know, but I...
2
by: Bendik Engebretsen | last post by:
I'm an ASP newbie and have just started experimenting with ASP.NET 2.0 using the VS.NET 2005 Beta. As a starting point I have used the 'Personal WEB site' starter kit. I am now trying to figure...
1
by: sagarkandekar | last post by:
Hi, I want to enable the Button after clicking the another button in the gridview. Here is my code: <asp:TemplateField> <ItemTemplate> <asp:LinkButton ID="Comment" Text ="Comment"...
56
by: Deepan HTML | last post by:
Hi All, Currently i am working in a framed environment where i have divided the window as 20% and 80% and the 20% is used for navigation purpose and right frame for displaying the orignal content....
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
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.