Use this function to get the name of the form in asp.net.
This can be used if the name of the form on the client is needed, for
example, you might need the form name in javascript.
Modify the return to statement to return what is needed.
For the "ctrl" parameter, pass the page reference or any control
reference located inside the form.
==================Begin Code===============
Public Function GetFormName(ByVal ctrl As Control) As String
Dim p As Control = ctrl.Parent
While Not TypeOf p Is System.Web.UI.HtmlControls.HtmlForm
p = p.Parent
End While
Return p.ID 'Returns ID of Form
'Return p.ClientID 'Returns Generated ID of Form
End Function
==================End Code===============