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

<div id="help" runat="server"></div>

Most of the asp.net learning I've done has been from books that were written
during the 1.0 framework. I didn't have a copy of visual studio when I
started reading them then I got a hold of VS 2005 Beta 1, then Beta 2.

I was using the <div runat="server"> statement on my projects. Once I placed
a <div id="testdiv" runat="server"> within my aspx page, I could then
manipulate it in the code behind like so:

testdiv.visible = true
testdiv.innerhtml = mystring

I recently got a copy of VS 2003 developer and started to recode a project
of mine that I did under the 2.0 beta2 framework. I have been coming along
ok except for the <div> statement. For some reason, in the code behind, VS
does not recognize <div>. the testdiv portion of testdiv.visible = true is
underlined and says that it isn't declared.

Why would framework 1.0 and 2.0 (Visual studio) understand what it is but
the 1.1 not? If I can no longer use testdiv.innerhtml = mystring to produce
html output streams, then what do I do instead to output data tables in a
format that I want them to look instead of a simple grid?

TIA,
Jim
Nov 20 '05 #1
3 3455
The page framework has changed in 2.0. With Partial Classes, the codebehind
and the aspx file are the same class. So your testdiv which is declared in
the aspx file is readily visible in your codebehind.

in 1.1 the aspx file inherited from the codebehind. If you declare and
instantiate a control in your aspx, it must be separately declared in your
codebehind file as well.

All that to say, put:
Protected testdiv as HtmlGenericControl in your codebehind's class

public class MyPage
inherits Page

Protected testdiv as HtmlGenericControl //the name here matches the Id
of the control

sub Page_load(..)
testvid.whatever = whatever

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Jim in Arizona" <ti*******@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP15.phx.gbl...
Most of the asp.net learning I've done has been from books that were
written during the 1.0 framework. I didn't have a copy of visual studio
when I started reading them then I got a hold of VS 2005 Beta 1, then Beta
2.

I was using the <div runat="server"> statement on my projects. Once I
placed a <div id="testdiv" runat="server"> within my aspx page, I could
then manipulate it in the code behind like so:

testdiv.visible = true
testdiv.innerhtml = mystring

I recently got a copy of VS 2003 developer and started to recode a project
of mine that I did under the 2.0 beta2 framework. I have been coming along
ok except for the <div> statement. For some reason, in the code behind, VS
does not recognize <div>. the testdiv portion of testdiv.visible = true is
underlined and says that it isn't declared.

Why would framework 1.0 and 2.0 (Visual studio) understand what it is but
the 1.1 not? If I can no longer use testdiv.innerhtml = mystring to
produce html output streams, then what do I do instead to output data
tables in a format that I want them to look instead of a simple grid?

TIA,
Jim

Nov 20 '05 #2
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:OS**************@TK2MSFTNGP12.phx.gbl...
The page framework has changed in 2.0. With Partial Classes, the
codebehind and the aspx file are the same class. So your testdiv which is
declared in the aspx file is readily visible in your codebehind.

in 1.1 the aspx file inherited from the codebehind. If you declare and
instantiate a control in your aspx, it must be separately declared in your
codebehind file as well.

All that to say, put:
Protected testdiv as HtmlGenericControl in your codebehind's class

public class MyPage
inherits Page

Protected testdiv as HtmlGenericControl //the name here matches the Id
of the control

sub Page_load(..)
testvid.whatever = whatever

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Jim in Arizona" <ti*******@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP15.phx.gbl...
Most of the asp.net learning I've done has been from books that were
written during the 1.0 framework. I didn't have a copy of visual studio
when I started reading them then I got a hold of VS 2005 Beta 1, then
Beta 2.

I was using the <div runat="server"> statement on my projects. Once I
placed a <div id="testdiv" runat="server"> within my aspx page, I could
then manipulate it in the code behind like so:

testdiv.visible = true
testdiv.innerhtml = mystring

I recently got a copy of VS 2003 developer and started to recode a
project of mine that I did under the 2.0 beta2 framework. I have been
coming along ok except for the <div> statement. For some reason, in the
code behind, VS does not recognize <div>. the testdiv portion of
testdiv.visible = true is underlined and says that it isn't declared.

Why would framework 1.0 and 2.0 (Visual studio) understand what it is but
the 1.1 not? If I can no longer use testdiv.innerhtml = mystring to
produce html output streams, then what do I do instead to output data
tables in a format that I want them to look instead of a simple grid?

TIA,
Jim

Thanks Karl. I will certainly give that a try. If I find myself producing
more gray hair than normal, I'll get back to you! ;o)
Nov 20 '05 #3
Hi Jim,

It all depends on the coding model you're using. If you are coding in .Net
1.1 and using the CodeBehind model, the Page Template inherits the
CodeBehind. Therefore, you need to declare the div as an HtmlGenericControl
in the CodeBehind class, and give it Protected access, so that it defines
the div in the inherited Page class. If you use the Code-in-Page model, you
don't have to do this.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
If you push something hard enough,
it will fall over.
- Fudd's First Law of Opposition

"Jim in Arizona" <ti*******@hotmail.com> wrote in message
news:uZ**************@TK2MSFTNGP15.phx.gbl...
Most of the asp.net learning I've done has been from books that were
written during the 1.0 framework. I didn't have a copy of visual studio
when I started reading them then I got a hold of VS 2005 Beta 1, then Beta
2.

I was using the <div runat="server"> statement on my projects. Once I
placed a <div id="testdiv" runat="server"> within my aspx page, I could
then manipulate it in the code behind like so:

testdiv.visible = true
testdiv.innerhtml = mystring

I recently got a copy of VS 2003 developer and started to recode a project
of mine that I did under the 2.0 beta2 framework. I have been coming along
ok except for the <div> statement. For some reason, in the code behind, VS
does not recognize <div>. the testdiv portion of testdiv.visible = true is
underlined and says that it isn't declared.

Why would framework 1.0 and 2.0 (Visual studio) understand what it is but
the 1.1 not? If I can no longer use testdiv.innerhtml = mystring to
produce html output streams, then what do I do instead to output data
tables in a format that I want them to look instead of a simple grid?

TIA,
Jim

Nov 20 '05 #4

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

Similar topics

13
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
1
by: Jeff | last post by:
I am getting Unable to find operator in query string. Query string currently is INSERT INTO Results (Name,Email,Comments,File) VALUES ('::Name::','::Email::','::Comments::','::File::') Here...
4
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...
1
by: Mark Sandfox | last post by:
Is there a way to restrict the user to only selecting and sending either a ..gif or .jpg. Everything I have read says this option can not be done by design (security reasons). I find that irronic...
0
by: Henri | last post by:
Hi, I've built a custom control named Tree in MyNameSpace.Tree compiled into dans MyNameSpace.Tree.dll I've then designed a page index.asp with its code in index.aspx.vb (class PageIndex)....
4
by: Kevin Blount | last post by:
bit long winded this one, so stick with me: I'm trying to create a form that can go to one of 3 places, depending on various elements. My form control looks like this: <form runat="server"...
3
by: Gert | last post by:
Would it be possible to access the file CONTENT in codebehind for a standard: <input id="htmlFile" type="file" /> Then in codebehind: foreach (string keyName in...
1
by: inungh | last post by:
I tried to place a grid view on my design view and connect to new data source to local SQL Express server Northwind database. I got error message on line 80 <authentication mode="Windows"/> ...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.