PC Review


Reply
Thread Tools Rate Thread

Detecting the form name

 
 
Michael Albanese
Guest
Posts: n/a
 
      4th Aug 2003
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

 
Reply With Quote
 
 
 
 
Bryan Martin
Guest
Posts: n/a
 
      4th Aug 2003
Why not just pass a instance of the textbox to the control?

"Michael Albanese" <(E-Mail Removed)> wrote in message
news:063101c35a87$b6efcec0$(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Lewis Wang [MSFT]
Guest
Posts: n/a
 
      5th Aug 2003
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" <(E-Mail Removed)>
| Sender: "Michael Albanese" <(E-Mail Removed)>
| Subject: Detecting the form name
| Date: Mon, 4 Aug 2003 05:55:43 -0700
| Lines: 13
| Message-ID: <063101c35a87$b6efcec0$(E-Mail Removed)>
| 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
|
|

 
Reply With Quote
 
Lewis Wang [MSFT]
Guest
Posts: n/a
 
      5th Aug 2003
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" <(E-Mail Removed)>
| Sender: "Michael Albanese" <(E-Mail Removed)>
| Subject: Detecting the form name
| Date: Mon, 4 Aug 2003 05:55:43 -0700
| Lines: 13
| Message-ID: <063101c35a87$b6efcec0$(E-Mail Removed)>
| 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
|
|

 
Reply With Quote
 
Lewis Wang [MSFT]
Guest
Posts: n/a
 
      5th Aug 2003
Hi Michael ,

You are welcome. Thanks for participating in community.

Regards,
Lewis

--------------------
| From: Michael Albanese <(E-Mail Removed)>
| References: <(E-Mail Removed)>
| 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: <(E-Mail Removed)>
| 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
|
|
|
|
| *** Sent via Developersdex http://www.developersdex.com ***
| Don't just participate in USENET...get rewarded for it!
|

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Detecting changes on a form Sir Psycho Microsoft Dot NET Framework Forms 4 1st May 2007 07:09 PM
Detecting changes on form John Microsoft Access 2 21st Feb 2007 01:31 PM
Detecting changes on form John Microsoft Access Forms 2 21st Feb 2007 01:31 PM
Detecting changes on form John Microsoft Access Form Coding 2 21st Feb 2007 01:31 PM
Detecting if Form is Open Chaplain Doug Microsoft Access Forms 1 21st Mar 2004 03:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:43 AM.