473,809 Members | 2,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Y "object expected" ?

Hi,
I have problem to get the control id and set its visible to true/false(mean
show/hide).

here is my code:
<%@ Control Language="vb" AutoEventWireup ="false"
Codebehind="ucN avbar.ascx.vb" Inherits="UserI nterfaceDesign. ucNavbar"
TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>

<A id="hpL" href="" DESIGNTIMEDRAGD ROP="59" runat="server"
onmouseover="wi ndow.status='<I >text to display in status bar</I>'; return
true;">
Make Request</A>

<asp:linkbutt on id="lbtnSupport " runat="server"
Width="104px">S upport</asp:linkbutton>
<asp:linkbutt on id="lbtnLogoff " runat="server"> Log off</asp:linkbutton>
<DIV id="divNavmaker eq" style="VISIBILI TY: visible; WIDTH: 144px; POSITION:
relative; HEIGHT: 100px; BACKGROUND-COLOR: aqua"
runat="server" ms_positioning= "GridLayout"><I NPUT style="Z-INDEX: 101;
LEFT: 8px; POSITION: absolute; TOP: 8px" type="button" value="Yahoo"></DIV>
<script type="text/javascript">
function fn_mouseoverjav ascript(){
alert(document. getElementById( 'divNavmakereq' );
}

</script>

in the javascript function, i try to show the control name, the error
message prompt:
object expected. Actually my concern is to show / hide the divNavmakereq
control.

have any ideas?
I already out of ideas.
thank you in advance.

best regards,
GL
Nov 19 '05 #1
4 2220
Have you checked the name of the DIV tag.

When you use controls, generally your TAGS are renamed UC1_IDNAME (or
something like that)

Double check the ID name like this:
When you are viewing the Webpage in IE, click View --> Source
Look at the DIV tag you are trying to use, and check its name has not
changed from divNavmakereq to something else
If it has, thats your problem, just update you JavaScript with the right
ID name

alert(document. getElementById( 'TheNameYouFind InTheSource'); //not sure
what you trying to do with that line, might need to add ID in there to get a
value

But what you really want is
document.getEle mentById('TheNa meYouFindInTheS ource').style.v isibility =
"hidden";

"Daniel" <Da****@discuss ions.microsoft. com> wrote in message
news:24******** *************** ***********@mic rosoft.com...
Hi,
I have problem to get the control id and set its visible to
true/false(mean
show/hide).

here is my code:
<%@ Control Language="vb" AutoEventWireup ="false"
Codebehind="ucN avbar.ascx.vb" Inherits="UserI nterfaceDesign. ucNavbar"
TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>

<A id="hpL" href="" DESIGNTIMEDRAGD ROP="59" runat="server"
onmouseover="wi ndow.status='<I >text to display in status bar</I>'; return
true;">
Make Request</A>

<asp:linkbutt on id="lbtnSupport " runat="server"
Width="104px">S upport</asp:linkbutton>
<asp:linkbutt on id="lbtnLogoff " runat="server"> Log off</asp:linkbutton>
<DIV id="divNavmaker eq" style="VISIBILI TY: visible; WIDTH: 144px;
POSITION:
relative; HEIGHT: 100px; BACKGROUND-COLOR: aqua"
runat="server" ms_positioning= "GridLayout"><I NPUT style="Z-INDEX: 101;
LEFT: 8px; POSITION: absolute; TOP: 8px" type="button"
value="Yahoo"></DIV>
<script type="text/javascript">
function fn_mouseoverjav ascript(){
alert(document. getElementById( 'divNavmakereq' );
}

</script>

in the javascript function, i try to show the control name, the error
message prompt:
object expected. Actually my concern is to show / hide the divNavmakereq
control.

have any ideas?
I already out of ideas.
thank you in advance.

best regards,
GL

Nov 19 '05 #2
HI Grant Merwitz,
thanks for ur respond.
i have a question, actually the source code is from user control page.
i try to show/hide the divNavmakereq.
So, the technique is still same as u replied to me ?

"Grant Merwitz" wrote:
Have you checked the name of the DIV tag.

When you use controls, generally your TAGS are renamed UC1_IDNAME (or
something like that)

Double check the ID name like this:
When you are viewing the Webpage in IE, click View --> Source
Look at the DIV tag you are trying to use, and check its name has not
changed from divNavmakereq to something else
If it has, thats your problem, just update you JavaScript with the right
ID name

alert(document. getElementById( 'TheNameYouFind InTheSource'); //not sure
what you trying to do with that line, might need to add ID in there to get a
value

But what you really want is
document.getEle mentById('TheNa meYouFindInTheS ource').style.v isibility =
"hidden";

"Daniel" <Da****@discuss ions.microsoft. com> wrote in message
news:24******** *************** ***********@mic rosoft.com...
Hi,
I have problem to get the control id and set its visible to
true/false(mean
show/hide).

here is my code:
<%@ Control Language="vb" AutoEventWireup ="false"
Codebehind="ucN avbar.ascx.vb" Inherits="UserI nterfaceDesign. ucNavbar"
TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>

<A id="hpL" href="" DESIGNTIMEDRAGD ROP="59" runat="server"
onmouseover="wi ndow.status='<I >text to display in status bar</I>'; return
true;">
Make Request</A>

<asp:linkbutt on id="lbtnSupport " runat="server"
Width="104px">S upport</asp:linkbutton>
<asp:linkbutt on id="lbtnLogoff " runat="server"> Log off</asp:linkbutton>
<DIV id="divNavmaker eq" style="VISIBILI TY: visible; WIDTH: 144px;
POSITION:
relative; HEIGHT: 100px; BACKGROUND-COLOR: aqua"
runat="server" ms_positioning= "GridLayout"><I NPUT style="Z-INDEX: 101;
LEFT: 8px; POSITION: absolute; TOP: 8px" type="button"
value="Yahoo"></DIV>
<script type="text/javascript">
function fn_mouseoverjav ascript(){
alert(document. getElementById( 'divNavmakereq' );
}

</script>

in the javascript function, i try to show the control name, the error
message prompt:
object expected. Actually my concern is to show / hide the divNavmakereq
control.

have any ideas?
I already out of ideas.
thank you in advance.

best regards,
GL


Nov 19 '05 #3
Thank you. I already get..hehe

"Daniel" wrote:
Hi,
I have problem to get the control id and set its visible to true/false(mean
show/hide).

here is my code:
<%@ Control Language="vb" AutoEventWireup ="false"
Codebehind="ucN avbar.ascx.vb" Inherits="UserI nterfaceDesign. ucNavbar"
TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>

<A id="hpL" href="" DESIGNTIMEDRAGD ROP="59" runat="server"
onmouseover="wi ndow.status='<I >text to display in status bar</I>'; return
true;">
Make Request</A>

<asp:linkbutt on id="lbtnSupport " runat="server"
Width="104px">S upport</asp:linkbutton>
<asp:linkbutt on id="lbtnLogoff " runat="server"> Log off</asp:linkbutton>
<DIV id="divNavmaker eq" style="VISIBILI TY: visible; WIDTH: 144px; POSITION:
relative; HEIGHT: 100px; BACKGROUND-COLOR: aqua"
runat="server" ms_positioning= "GridLayout"><I NPUT style="Z-INDEX: 101;
LEFT: 8px; POSITION: absolute; TOP: 8px" type="button" value="Yahoo"></DIV>
<script type="text/javascript">
function fn_mouseoverjav ascript(){
alert(document. getElementById( 'divNavmakereq' );
}

</script>

in the javascript function, i try to show the control name, the error
message prompt:
object expected. Actually my concern is to show / hide the divNavmakereq
control.

have any ideas?
I already out of ideas.
thank you in advance.

best regards,
GL

Nov 19 '05 #4
oh, HAHA

I was writing the reply but got distracted.

Well, waste not want not.

Here's what i was saying:
as this div tag has a Runat=server, when this control is implemented into
you page, it will rename it with the TagName you specified.

so, if you register you tag like so:

<%@ Regoster TagPrefix="uc1" TagName="MyCont rol" ...

and you called your Div Tag 'divNavmakereq'

This will be renamed at run time to :
MyControl_divNa vmakereq - or something like that

So, when you testing your control, on the page its being used (aspx), view
the source of that page and get its ID.
Bearing in mind, this control will have to have the same TagName wherever it
is used - or this code will not work in that instance.

There's also probably a better way of doing this that its not dependent on
the ID so much, like passing the control to your JavaScript.
But this will work

"Daniel" <Da****@discuss ions.microsoft. com> wrote in message
news:D0******** *************** ***********@mic rosoft.com...
Thank you. I already get..hehe

"Daniel" wrote:
Hi,
I have problem to get the control id and set its visible to
true/false(mean
show/hide).

here is my code:
<%@ Control Language="vb" AutoEventWireup ="false"
Codebehind="ucN avbar.ascx.vb" Inherits="UserI nterfaceDesign. ucNavbar"
TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>

<A id="hpL" href="" DESIGNTIMEDRAGD ROP="59" runat="server"
onmouseover="wi ndow.status='<I >text to display in status bar</I>'; return
true;">
Make Request</A>

<asp:linkbutt on id="lbtnSupport " runat="server"
Width="104px">S upport</asp:linkbutton>
<asp:linkbutt on id="lbtnLogoff " runat="server"> Log off</asp:linkbutton>
<DIV id="divNavmaker eq" style="VISIBILI TY: visible; WIDTH: 144px;
POSITION:
relative; HEIGHT: 100px; BACKGROUND-COLOR: aqua"
runat="server" ms_positioning= "GridLayout"><I NPUT style="Z-INDEX: 101;
LEFT: 8px; POSITION: absolute; TOP: 8px" type="button"
value="Yahoo"></DIV>
<script type="text/javascript">
function fn_mouseoverjav ascript(){
alert(document. getElementById( 'divNavmakereq' );
}

</script>

in the javascript function, i try to show the control name, the error
message prompt:
object expected. Actually my concern is to show / hide the divNavmakereq
control.

have any ideas?
I already out of ideas.
thank you in advance.

best regards,
GL

Nov 19 '05 #5

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

Similar topics

4
47633
by: Danny | last post by:
Hi I don't understand why I keep getting "Error: Object expected" I tried different things and haven't been able to solve it. I'm a newbie so I'm not sure what I'm doing wrong. The debugger breaks at the <BODY> Tag of my code so I'm thinking the problem is with my InitPage() function. I appreciate the advice. Here is my code. <SCRIPT LANGUAGE="Javascript"> <!-- var flag = false;
22
3353
by: Dr Duck | last post by:
GDay all, Something seems odd to me.... I wrote a simple C# function public void bind(ref object a, ref object b, bool atob) { if(atob) b = a; else
5
2727
by: Rick | last post by:
I wrote the following code as part of a page where users can reorder a list of items by highlighting an item in a list box and clicking an "up" or "down" button to move the items around. The code below is for the up and down buttons along with a reset button (which reloads the list as it was originally) and a change button which applies the changes. In Explorer and Safari for Mac, this code works flawlessly. When I tested on Explorer in...
16
47705
by: Steve Chapel | last post by:
When I load the page <https://bugzilla.mozilla.org/attachment.cgi?id=237739with Internet Explorer 7 RC 1, I get the error "Object Expected" at line 174. When I click on the button, I also get the same error on line 186. This same HTML and JavaScript works perfectly in Firefox and Opera. How can I make the code work in IE?
1
2153
by: monudjn | last post by:
Hi I am implementing ajax in portal. Using ajax i am able to updating the content of portlets asynchronously. However i am facing a problem The Problem: While submitting the form i am getting javascript error " Object expected". These errors i am getting after implementing ajax. Also this error is shown only the first time i trying to submit. Next time this error won't come. This may be because the ajax update the content dynamically and if...
10
13326
RMWChaos
by: RMWChaos | last post by:
WinVista/IE7 I am getting some weird errors only in IE7, but not in FF2.0.0.8 or NN9. It even happens on this website when I click "Sign In". The error is: "A Runtime Error has occurred." "Line:xxx" "Error: Object expected" and Debug says: "Microsoft JScript runtime error: Object expected."
2
5746
by: thj | last post by:
Hi. I've got this form that I'm trying to validate: <form id="periodForm" action="" method="post"> <p> Periode: <input id="startDate" name="startDate" type="text" size="7" value="<%= ViewData %>" /> -
9
27643
by: erictheone | last post by:
Ok so what I'm trying to do is create a trans location cipher. For those among us that don't know alot about cryptography it is a method for jumbling up letters to disguise linguistic patterns(words). What it does is takes a string as a parameter, determines length of string, tests if the length is a perfect square, if it is then it makes a 2-d array with its length and height equal to the lengths root. If it isn't then it cuts it down to...
0
2626
by: jb489 | last post by:
Hi all, Hope I am posting this in the right forum. I seem to be having a problem when using serialization and web services. <b>Scenario:</b> I have built a web service which includes a multitude of web methods. All the web methods have various parameters, but one parameter which they all have in common is an 'object' parameter. This is due to the fact that the web service works differently according to the type of object being...
0
10639
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
10376
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...
1
10383
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10120
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...
1
7661
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
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
5688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
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.