473,405 Members | 2,445 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,405 software developers and data experts.

asp.net 2 control definition

on windows form application , when I drag a button to the form...
The button declaration is created above on the code + it's properties

on Visual studio 2005 Web application
I draged a button to the page
but I cant find that button declaration in the code (only in the
html)

My question is...
How can I create buttons manualy through the code and display them on
the web page ?

Jul 13 '07 #1
1 1272
Hi,

if you use the default web site model, adding a control on page doesn't
create a declaration for it (you don't need to have it, ASP.NET does it
automatically for you as it creates a partial class based on your aspx, so
that you have the members available automatically)

If you use VS2005 web application, it adds them into
pagename.designer.aspx.cs (or .vb) file.

Still you create controls in code by instantiating the corresponding class
and adding it to Controls collection on the Page (into the Form or
PalceHolder whatever/wherever you add it)

Button b=new Button();
PlaceHolder1.Controls.Add(b);
--
Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net
"ShayHk" <sh****@gmail.comwrote in message
news:11**********************@d55g2000hsg.googlegr oups.com...
on windows form application , when I drag a button to the form...
The button declaration is created above on the code + it's properties

on Visual studio 2005 Web application
I draged a button to the page
but I cant find that button declaration in the code (only in the
html)

My question is...
How can I create buttons manualy through the code and display them on
the web page ?

Jul 13 '07 #2

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

Similar topics

13
by: Will Pittenger | last post by:
I have a Control derived class. When the parent of the control changes the control's Location property, the stack overflows. I have not found a way to find out what was on the stack when it does...
0
by: Chris Millar | last post by:
I have a user control that i wish to extend to change the date when the user selects the numeric up down button. The code explains itself, hope someone can help. any ideas appreaciated.. ...
6
by: Tom Rowton | last post by:
This one has me a bit confused and I'm not finding what I need in the MSDN or by searching these forums, so here goes... I have a rather large, complex code-in-page WebForm (don't ask) and a...
1
by: Lauchlan M | last post by:
Hi. I have an ASP.net project that works fine. I copied it to another project using the following steps: << (i) create a new VS.NET ASP.NET project.
0
by: Brian Young | last post by:
Hi all. I'm using the Property Grid control in a control to manage a windows service we have developed here. The windows service runs a set of other jobs that need to be managed. The control...
3
by: Mad Bull | last post by:
I am a newbie. I have created a page which upon load connects to SQL Server and runs a stored procedure. The data returned from this is assigned to some asp:labels and asp:textbox controls. This...
4
by: simon | last post by:
hello. relatively new to vb.net, i'm using VS 2003 and .net 2.0 i have a web app that i'm i have a user control that displays a simple 1 row table as the header of the page. the user control...
3
by: YYZ | last post by:
I am trying to add 5 "Web User Controls" for use on one WebForm. My idea was to take kind of a wizard approach -- show uc1 and hide the the other 4...then next run of the page, show uc2 and hide...
1
by: Charlie | last post by:
Hi: I need to share a control across virtual directories because it will be used by multiple applications. I know I can create a custom control and share out dll, but that won't do because it...
4
by: Zeke | last post by:
(VS 2005 Prof) Please give me some help on how to use an activeX control. I have done the following: - created a dll with one class (Utils) which has functions - imported the ActiveX with tlbimp...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
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
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...
0
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...

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.