473,511 Members | 14,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

html id not working in code behind

I am using VS 2008 and have an "id" on my "body" tag but I can't seem to
access it from my code behind. Do I need an Imports of some kind to access
or something else?

In my .aspx page I have:

<body id="myBody">

and in my .aspx.vb I have:

myBody.Attributes.Add("onLoad",
"document.forms[0].SearchName.focus()")

With my imports:

Option Strict On
Imports System.Data
Imports System.Data.SqlClient
Imports MyFunctions.BitHandling
Imports System.Drawing
Imports MyFunctions
Imports RolesBasedAuthentication

Am I missing something?

Thanks,

Tom
Sep 23 '08 #1
2 1009
"tshad" <tf*@dslextreme.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I am using VS 2008 and have an "id" on my "body" tag but I can't seem to
access it from my code behind. Do I need an Imports of some kind to access
or something else?
Something else...
Am I missing something?
Yes.
<body id="myBody">
<body id="myBody" runat="server">
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 23 '08 #2

"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message
news:uW**************@TK2MSFTNGP04.phx.gbl...
"tshad" <tf*@dslextreme.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>I am using VS 2008 and have an "id" on my "body" tag but I can't seem to
access it from my code behind. Do I need an Imports of some kind to
access or something else?

Something else...
>Am I missing something?

Yes.
><body id="myBody">

<body id="myBody" runat="server">
Of course.

Little mind fade there.

I always added this to my body tag in the past and just forgot to add it
when I put the id in.

Thanks,

Tom
>

--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Sep 23 '08 #3

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

Similar topics

2
8374
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
12
1716
by: SStory | last post by:
Doing pages for contract..... If I make an ASPX file that does certain things, how simple would it be for a person who know nothing about it to modify the user interface without bothering the...
4
4257
by: Tim Mulholland | last post by:
I have one page where i have some <div> tags set to be runat="server" (and i've given them an id) and i can access them from the code-behind file just fine. I have another page where i've done...
4
1352
by: Paul Mason | last post by:
Hi folks, Just wondering how I can call a function in a code behind file from within the body of the ASPX file. The old ASP way was to use <%= MyFunction() %>, but that doesn't seem to work...
4
3014
by: tma | last post by:
I'm trying to retrieve values for my HTML from the Codebehind file and I'm unclear how to accomplish this. For example: <INPUT TYPE="hidden" NAME="amount" VALUE="xx"> How do I populate the...
2
12153
by: Corno | last post by:
Hi all, I have a page with a table of which the rows have to be added dynamically. What I also want is 'code behind' the onclick event of a row (the page should be posted back to the server,...
6
5479
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
0
950
by: Oded | last post by:
Hi, I'm working on an ASP.NET application, written in C#, using VS.NET . When working on aspx pages, HTML completion does not work (neither tag closing nor statement completion). Completion works...
3
1439
by: aaa | last post by:
I fail to see the connection between the code behind and the raw HTML of the ASPX page how do you get variables and functions to communicate with each other? I cannot get this to even fire:...
5
3565
by: serge calderara | last post by:
Dear all, I am new in asp.net and prepare myself for exam I still have dificulties to understand the difference between server control and HTML control. Okey things whcih are clear are the fact...
0
7237
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,...
0
7349
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
7417
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
7506
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...
1
5063
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...
0
4734
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...
0
3219
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...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
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...

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.