473,379 Members | 1,260 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,379 software developers and data experts.

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="ucNavbar.ascx.vb" Inherits="UserInterfaceDesign.ucNavbar"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

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

<asp:linkbutton id="lbtnSupport" runat="server"
Width="104px">Support</asp:linkbutton>
<asp:linkbutton id="lbtnLogoff" runat="server">Log off</asp:linkbutton>
<DIV id="divNavmakereq" style="VISIBILITY: visible; WIDTH: 144px; POSITION:
relative; HEIGHT: 100px; BACKGROUND-COLOR: aqua"
runat="server" ms_positioning="GridLayout"><INPUT style="Z-INDEX: 101;
LEFT: 8px; POSITION: absolute; TOP: 8px" type="button" value="Yahoo"></DIV>
<script type="text/javascript">
function fn_mouseoverjavascript(){
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 2191
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('TheNameYouFindInThe Source'); //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.getElementById('TheNameYouFindInTheSource ').style.visibility =
"hidden";

"Daniel" <Da****@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.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="ucNavbar.ascx.vb" Inherits="UserInterfaceDesign.ucNavbar"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

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

<asp:linkbutton id="lbtnSupport" runat="server"
Width="104px">Support</asp:linkbutton>
<asp:linkbutton id="lbtnLogoff" runat="server">Log off</asp:linkbutton>
<DIV id="divNavmakereq" style="VISIBILITY: visible; WIDTH: 144px;
POSITION:
relative; HEIGHT: 100px; BACKGROUND-COLOR: aqua"
runat="server" ms_positioning="GridLayout"><INPUT style="Z-INDEX: 101;
LEFT: 8px; POSITION: absolute; TOP: 8px" type="button"
value="Yahoo"></DIV>
<script type="text/javascript">
function fn_mouseoverjavascript(){
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('TheNameYouFindInThe Source'); //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.getElementById('TheNameYouFindInTheSource ').style.visibility =
"hidden";

"Daniel" <Da****@discussions.microsoft.com> wrote in message
news:24**********************************@microsof t.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="ucNavbar.ascx.vb" Inherits="UserInterfaceDesign.ucNavbar"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

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

<asp:linkbutton id="lbtnSupport" runat="server"
Width="104px">Support</asp:linkbutton>
<asp:linkbutton id="lbtnLogoff" runat="server">Log off</asp:linkbutton>
<DIV id="divNavmakereq" style="VISIBILITY: visible; WIDTH: 144px;
POSITION:
relative; HEIGHT: 100px; BACKGROUND-COLOR: aqua"
runat="server" ms_positioning="GridLayout"><INPUT style="Z-INDEX: 101;
LEFT: 8px; POSITION: absolute; TOP: 8px" type="button"
value="Yahoo"></DIV>
<script type="text/javascript">
function fn_mouseoverjavascript(){
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="ucNavbar.ascx.vb" Inherits="UserInterfaceDesign.ucNavbar"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

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

<asp:linkbutton id="lbtnSupport" runat="server"
Width="104px">Support</asp:linkbutton>
<asp:linkbutton id="lbtnLogoff" runat="server">Log off</asp:linkbutton>
<DIV id="divNavmakereq" style="VISIBILITY: visible; WIDTH: 144px; POSITION:
relative; HEIGHT: 100px; BACKGROUND-COLOR: aqua"
runat="server" ms_positioning="GridLayout"><INPUT style="Z-INDEX: 101;
LEFT: 8px; POSITION: absolute; TOP: 8px" type="button" value="Yahoo"></DIV>
<script type="text/javascript">
function fn_mouseoverjavascript(){
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="MyControl" ...

and you called your Div Tag 'divNavmakereq'

This will be renamed at run time to :
MyControl_divNavmakereq - 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****@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.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="ucNavbar.ascx.vb" Inherits="UserInterfaceDesign.ucNavbar"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

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

<asp:linkbutton id="lbtnSupport" runat="server"
Width="104px">Support</asp:linkbutton>
<asp:linkbutton id="lbtnLogoff" runat="server">Log off</asp:linkbutton>
<DIV id="divNavmakereq" style="VISIBILITY: visible; WIDTH: 144px;
POSITION:
relative; HEIGHT: 100px; BACKGROUND-COLOR: aqua"
runat="server" ms_positioning="GridLayout"><INPUT style="Z-INDEX: 101;
LEFT: 8px; POSITION: absolute; TOP: 8px" type="button"
value="Yahoo"></DIV>
<script type="text/javascript">
function fn_mouseoverjavascript(){
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
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...
22
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
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...
16
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...
1
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...
10
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."...
2
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="<%=...
9
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...
0
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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...

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.