Ask a Question related to ASP.NET General, Design and Development.
-
sc #1
Form Tag of Current Page?
From my codebehind, I am trying to get an object reference to the
current form, so I can perform a FindControl and work with one of the
child controls.
My problem is that I never know the name of the control. How to find
that (using Reflection?)?
Thanks.
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
sc Guest
-
adding current date into Access using DW form
I've looked all over this forum finding similar solutions but not exactly what I'm looking for. Relatively simple. My Access 2002 database has a... -
Get the name of the current page
How do I get the name of the current .aspx page using vb.net in asp.net? TIA, Steve Wofford www.IntraRELY.com -
redirect to another page based on text in the URL of the current page
Hi JPElectron, You were looking good until you got to the code. You're trying to use client-side code for your redirects, when you should be... -
Send current record data in one form to another and print?
On Tue, 15 Jul 2003 10:09:12 -0700, "Seddon Acaster" <seddonandjulia@acas.demon.co.uk> wrote: Clarification: The Form doesn't contain any... -
Autofill current date in field on form
Need a field to autofill the current date on a form. The user will be filling in one field with a control number and the date field will be the... -
Matt Sollars #2
Re: Form Tag of Current Page?
Hi, sc:
Well, one not-so-robust way of finding the form control for a page is to
iterate through the page's controls until you find one that is of type
HtmlForm. Some sample VB code follows.
-------------
' Iterate the Page's controls for the HtmlForm
dim MyForm as HtmlForm
for each control as Control in Page.Controls
if TypeOf control is HtmlForm then
MyForm = CType(control, HtmlForm)
exit for
end if
next
' Test for a match
' *** This really isn't necessary since there has to be a match for server
other controls to even work
if not MyForm is Nothing then
' Do something with the form control
end if
-------------
This isn't ideal, I know. However, considering the page control tree, it
hasn't taken very long at all to find the form control in my tests.
Hope this helps,
Matt
Matt Sollars Guest



Reply With Quote

