Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > how to get form id in a composite control?

Thread Tools

how to get form id in a composite control?

Robin Lilly'
Posts: n/a

I have a composite control that I need to reference the form id to build
some javascript that I am pushing out several places, such as:

_Anchor.Attributes.Add("OnClick", "JavaScriptopUpCalendar(this, document."
& _formId & ".elements['" & _TextBox.UniqueID & "'], ""m/d/yyyy"")")

Where _formId would need to be the page form tag.



Reply With Quote
Scott Mitchell [MVP]
Posts: n/a
Robin, I've wondered this myself, and after poking through the source
code using Reflector [], I was unable
to find a means. The approach used by Steve Stchur in this article,
Maintaining Scroll Position on Postback
[], offers one
workaround - recursing through the control hierarchy, searching for an
HtmlForm object.

If there is another way, please let me know!


Scott Mitchell Removed)

* When you think ASP.NET, think!
Reply With Quote
Robin Lilly
Posts: n/a

Thanks for the reply. I'm going to take the one from Steve and put it in
a Utilites class. I had been really struggling looking at the page
class, searching, etc trying to figure where the "form id tag" property
was located.


Robin Lilly

*** Sent via Developersdex ***
Don't just participate in USENET...get rewarded for it!
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Composite vs non composite Controls Mike ASP .Net Web Controls 4 03-11-2005 05:47 AM
Losing Composite Control property that another Composite Control ... Chad ASP .Net Building Controls 0 02-01-2005 09:01 PM
Possible to create a composite control that has a child control that is a validator that validates the composite control itself? Jonathan Eric Miller ASP .Net Building Controls 2 07-22-2004 10:58 PM
Composite control with dynamic composite controls sleigh ASP .Net 1 02-12-2004 06:24 PM