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

html controls in webforms

GM
Is it possible to access html controls from Webform controls?

thanks,

Nov 16 '05 #1
2 1076
What exactly do you mean by your question? If you want to access html
controls from the code behind file then you just need to add a
'runat=server' attribute to the html control tag.

Cheers,
John Wadie

Nov 16 '05 #2
Hi,

Yes, you can access it IF you declare in the page a runat=server
in general you can have access to ANY html tag, all you have to do is
declare it with the above attribute and you can access it as
HtmlGenericControl

ie:
in the code behind:
protected System.Web.UI.HtmlControls.HtmlGenericControl PageTitle;
in the aspx page:
<body runat=server id="BODY">

you can then do things like:
BODY.Attributes.Add("OnLoad", "GotoMark();");
Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"GM" <GM@discussions.microsoft.com> wrote in message
news:2E**********************************@microsof t.com...
Is it possible to access html controls from Webform controls?

thanks,

Nov 16 '05 #3

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

Similar topics

2
by: Abel | last post by:
Hello - How can I utilize ViewState when my webform has dynamically generated controls? Is there a way to add/retrieve values to/from viewstate so that I can use ViewState? I'd rather not...
2
by: John | last post by:
Hi A client has provided an html sample page to be used as "template" for an asp.net enquiry form to maintain their intended look and feel. Info from the asp.net form is to be emailed on...
2
by: Joe | last post by:
Hi, I have a website with a mix of static (.html) and dynamic pages (.aspx) pages. I was wondering to change extension .html to .aspx , only to accommodate future needs of making static pages...
0
by: Joergen Bech | last post by:
Trying to implement my own webforms designer to be hosted in a WinForms environment. Basically: I know that mshtml is used in the VS.Net 2003 WebForms designer, but the HTML behind the scenes is...
2
by: Joe | last post by:
Hello All: I am writing to ask for your opinions. I have a colleague who combines his code with the markup used to display the code (reckoning back to classic ASP). Here's an example of a...
9
by: netasp | last post by:
hi all, how can I populate one aspx form when page is loading based on page ID? for example: loading page A (to search for VB code) would display labels and texboxes, dropdown lists all related...
1
by: Gustavo | last post by:
Hi, We are placing Windows Controls inside webforms for a project that needs to interact with files from a local computer. What would be the best way to make the following work: When a user...
11
by: Faisal Vali | last post by:
Are there any guidelines people use that help them decide when it is better to dynamically generate all html elements using javascript versus actually writing some html and using it as scaffolding?...
10
dj12345
by: dj12345 | last post by:
Hi, (Asp.net + Ajax) I am creating a page which will fetch data from server without postbak of a page.. I have 2 controls on this page TextBox and Lable. I have assigned TextBoxWatermark...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.