473,756 Members | 5,129 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<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.innerht ml = 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.innerht ml = 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 3494
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 HtmlGenericCont rol in your codebehind's class

public class MyPage
inherits Page

Protected testdiv as HtmlGenericCont rol //the name here matches the Id
of the control

sub Page_load(..)
testvid.whateve r = whatever

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Jim in Arizona" <ti*******@hotm ail.com> wrote in message
news:uZ******** ******@TK2MSFTN GP15.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.innerht ml = 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.innerht ml = 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******** ******@TK2MSFTN GP12.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 HtmlGenericCont rol in your codebehind's class

public class MyPage
inherits Page

Protected testdiv as HtmlGenericCont rol //the name here matches the Id
of the control

sub Page_load(..)
testvid.whateve r = whatever

Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Jim in Arizona" <ti*******@hotm ail.com> wrote in message
news:uZ******** ******@TK2MSFTN GP15.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.innerht ml = 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.innerht ml = 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 HtmlGenericCont rol
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*******@hotm ail.com> wrote in message
news:uZ******** ******@TK2MSFTN GP15.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.innerht ml = 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.innerht ml = 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
40757
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 style="display:none"> can be displayed by setting the style attribute to "display:", or hidden with "display:none". This gives the illusion that the person filling out the form is switching from page to page...without the overhead of extra hits on the server,...
1
1925
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 is the ASP Code..From Frontpage. <html>
4
4274
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 essentially the same thing (even copying the code from the other file) and i cannot access them from the code-behind file. Any clues what would cause this? Just a tad frustrating because i can't move forward on this page without
1
3295
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 as this is the reason (security) that I want to restrict their selection. Any help on this one will be greatly appreciated. The page is using ASP.NET.
0
1334
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). This page registrers my Tree control: <%@ Register TagPrefix="km" NameSpace="MyNameSpace" Assembly="tree.dll" %> Everything runs well when I compile aspx.vb myself without specifying any
4
2909
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" ID="myForm" method=POST> so, first thing: how can I dynamically set the "Action" parameter? I know that with <asp:HiddenField...for example, I have to do something like this:
3
10391
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 System.Web.HttpContext.Current.Request.Form.Keys) { //i can see keyName = "htmlFile" here as well as the "c:/myfile.txt" for example
1
4157
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"/> The full error message is following: D:\websites\begaspnet2db\web.config(80): Build (web): It is an error to use a section registered as allowDefinition='MachineToApplication'
0
9455
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9271
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10031
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...
1
9838
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
9708
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
7242
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
5140
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3354
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.