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 3 3464
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
"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)
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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)....
|
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"...
|
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...
|
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"/>
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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,...
|
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...
|
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...
| |