Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 23rd, 2003, 10:54 AM
cjo cjo is offline
Authorized User
 
Join Date: Oct 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default Referencing a "div" tag in a code behind file.

I hope this is a simple question for somebody.

I'm having trouble determining how to reference the following div tag in my code-behind file:

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

In my code-behind class, I'm referencing this div tag as follows:

public Div display;

I'm also attempting to use this Div tag in one of my code-behind event handlers as follows:

display.InnerHtml = strResultsHolder;

The compiler is generating the following error:

The type or namespace name 'Div' could not be found (are you missing a using directive or an assembly reference?)

I've tried to negotiate MSDN online to determine which namespace I need in order to use this div tag. System.Web.UI.HtmlControls doesn't do it.

Assuming that finding the correct namespace is the problem, can somebody please tell me either which namespace I need to reference in code-behind or how I can quickly determine which namespace I need to use (or both) in order to use this div tag?

Thank you in advance for any help you can offer!
 
Old December 23rd, 2003, 11:30 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

AFAIK, a <div> tag is a HtmlGenericControl. Take a look here:

http://msdn.microsoft.com/library/de...classtopic.asp

In situations like this, I search Google for stuff like System.Web.UI.HtmlControls div tag MSDN.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old December 23rd, 2003, 01:53 PM
cjo cjo is offline
Authorized User
 
Join Date: Oct 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the help. Turns out I had the right namespace, but the wrong class. HtmlGenericControl solved my problem. Thanks again Imar!





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to loop through a div tag? Byock Classic ASP Basics 0 December 19th, 2006 02:52 AM
div tag as link Stagmo Dreamweaver (all versions) 0 April 14th, 2006 12:35 AM
stop writing in Div tag Samikaraeen HTML Code Clinic 2 April 9th, 2006 01:29 AM
DIV TAG marclena ASP.NET 1.0 and 1.1 Professional 2 May 24th, 2005 11:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.