Detecting the form name

  • Thread starter Thread starter Michael Albanese
  • Start date Start date
M

Michael Albanese

I am trying to build a user control that will allow a user
to select a date from a calendar. I have to code that will
run on the calendar's SelectionChanged event, but i am at
a loss to return the data to the correct text box.

The question is...How do I detect the Form Name
programatically from a user control that is included on a
page. i.e. - me.formname....?

Thanks in advance for any help.

Michael Albanese
 
Hi Michael,

Bryan is right.

You can check this link. I think it should be helpful.
http://aspnet.4guysfromrolla.com/articles/030202-1.aspx

Best Regards,
Lewis

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| Content-Class: urn:content-classes:message
| From: "Michael Albanese" <[email protected]>
| Sender: "Michael Albanese" <[email protected]>
| Subject: Detecting the form name
| Date: Mon, 4 Aug 2003 05:55:43 -0700
| Lines: 13
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNah7bvBWljnXTaTKK+VrB41V0Zcg==
| Newsgroups: microsoft.public.dotnet.general
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:103351
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| I am trying to build a user control that will allow a user
| to select a date from a calendar. I have to code that will
| run on the calendar's SelectionChanged event, but i am at
| a loss to return the data to the correct text box.
|
| The question is...How do I detect the Form Name
| programatically from a user control that is included on a
| page. i.e. - me.formname....?
|
| Thanks in advance for any help.
|
| Michael Albanese
|
|
 
Hi Michael,

If the user control and the textbox are on the same page, then in the code
behind of the user control:

private void Button1_Click(object sender, System.EventArgs e)
{
TextBox t=(TextBox)this.Parent.FindControl("pageTextBox");
t.Text ="......" ;
}

Does this answer your question? Please let me know if you need more
information

Best Regards,
Lewis

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| Content-Class: urn:content-classes:message
| From: "Michael Albanese" <[email protected]>
| Sender: "Michael Albanese" <[email protected]>
| Subject: Detecting the form name
| Date: Mon, 4 Aug 2003 05:55:43 -0700
| Lines: 13
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcNah7bvBWljnXTaTKK+VrB41V0Zcg==
| Newsgroups: microsoft.public.dotnet.general
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:103351
| NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| I am trying to build a user control that will allow a user
| to select a date from a calendar. I have to code that will
| run on the calendar's SelectionChanged event, but i am at
| a loss to return the data to the correct text box.
|
| The question is...How do I detect the Form Name
| programatically from a user control that is included on a
| page. i.e. - me.formname....?
|
| Thanks in advance for any help.
|
| Michael Albanese
|
|
 
Hi Michael ,

You are welcome. Thanks for participating in community.

Regards,
Lewis

--------------------
| From: Michael Albanese <[email protected]>
| References: <[email protected]>
| X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
| Subject: RE: Detecting the form name
| Mime-Version: 1.0
| Content-Type: text/plain; charset="us-ascii"
| Content-Transfer-Encoding: 7bit
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.general
| Date: Tue, 05 Aug 2003 04:13:45 -0700
| NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
| Lines: 1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:103505
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Thanks for all of the input.
|
| Both the article and the code post were very helpful.
|
| I was able to build my controland move the project forward.
|
| Thanks again,
|
| Michael Albanese
|
|
|
|
|
| Don't just participate in USENET...get rewarded for it!
|
 
Back
Top