List Info

Thread: Re: UserControl And MasterPage




Re: UserControl And MasterPage
user name
2007-01-31 11:21:46
at the first Thankx for your replies.
  the realy probelm is in my javascript code is the Tree
data attribute,I have  a treeview in my usercontrol and i
have add my own RightClick Context menu on the Treeview. I
know that I can tell the javascript what is ClientID of my
treeview after rendering <%= Tree.ClientID %> that is
not a problem to me but the realy probelm is how to concat
the following attribute
  ctl00_ContentPlc1_Ctr_Tree1_Tree_Data
  How can i tell javascript to concat my TreeClientID with
_Data attribute !!!!?
   
  

Dean Fiala <dfialagmail.com> wrote:
          A better approach would be to tell the javascript
how the control was
rendered.

When you generate a page you can easily generate javascript
using all the
information you have available on the server, including the
exact client ID
of the control and all its context. Either write some
variables your script
can read, or generate a function it can call to get the info
it needs.

On 1/31/07, Justin Hersh <jhersheuservices.com> wrote:
>
> Adbulla,
>
> I am very interested as well because my understanding
of things you will
> not be able to tell via JavaScript where the control
originated. The
> issue is that at the point the JavaScript is executing
(on the client)
> the master page and the content panels have been
merged. The final
> markup is just html.
>
> That being said you could look at the auto assigned
id's (ex.
> _ctl0:dlInventory:_ctl9:orderButton) to provide some
information about
> the source of the control. The _ctl portion will give
you information
> about what parent container held a control. The problem
is that I don't
> know how to get any meaningful information from the
auto generated ID
> other then to tell that there was a separation between
parent
> containers.
>
> Hopefully this is a little helpful.
>
> _____
>
> From:
AspNetAnyQuestionIsOk@yahoogroups.com<AspNetAnyQuestionIs
Ok%40yahoogroups.com>
>
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com<AspNetAnyQu
estionIsOk%40yahoogroups.com>]
> On Behalf Of Abdulla Abd
> Al Haq
> Sent: Wednesday, January 31, 2007 4:15 AM
> To: .net1 .net2
> Subject: [AspNetAnyQuestionIsOk] UserControl And
MasterPage
>
> Hi Group,
> How can i know by javaScript if my Webusercontrol is in
MasterPage or in
> a regular page?
> i.e I want to write JavaScript Switch Statement in
webusercontrol to
> know if the usercontrol is in a masterpage then do
something and if the
> usercontrol is in a regulare page do a nother thing
>
> thanks in a dvanced
>
> ---------------------------------
> Looking for earth-friendly autos?
> Browse Top Cars by "Green Rating" at Yahoo!
Autos' Green Center.
>
> [Non-text portions of this message have been removed]
>
> [Non-text portions of this message have been removed]
>
> 
>

-- 
Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.com/blog
baby
Microsoft MVP

[Non-text portions of this message have been removed]



         

 
---------------------------------
Access over 1 million songs - Yahoo! Music Unlimited.

[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/join

    (Yahoo! ID required)

<*> To change settings via email:
    mailto:AspNetAnyQuestionIsOk-digest@yahoogroups.com 
   
mailto:AspNetAnyQuestionIsOk-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

Re: UserControl And MasterPage
user name
2007-01-31 11:41:30
As I stated before:
1) have your control render some script that indicates its
context,
something like

<script type="javascript>
    function SomeUsefulContextInfo(){
      return 'SomeID Or Something Else Your Javsascript
Function Can Use';
   }
</script>

2) alter your existing javascript to call this function and
use the returned
information to modify your javascript's behavior



On 1/31/07, Abdulla Abd Al Haq <abdulla_ah2001yahoo.com> wrote:
>
>   at the first Thankx for your replies.
> the realy probelm is in my javascript code is the Tree
data attribute,I
> have a treeview in my usercontrol and i have add my own
RightClick Context
> menu on the Treeview. I know that I can tell the
javascript what is ClientID
> of my treeview after rendering <%= Tree.ClientID
%> that is not a problem
> to me but the realy probelm is how to concat the
following attribute
> ctl00_ContentPlc1_Ctr_Tree1_Tree_Data
> How can i tell javascript to concat my TreeClientID
with _Data attribute
> !!!!?
>
>
>
> Dean Fiala <dfialagmail.com
<dfiala%40gmail.com>> wrote:
> A better approach would be to tell the javascript how
the control was
> rendered.
>
> When you generate a page you can easily generate
javascript using all the
> information you have available on the server, including
the exact client
> ID
> of the control and all its context. Either write some
variables your
> script
> can read, or generate a function it can call to get the
info it needs.
>
> On 1/31/07, Justin Hersh <jhersheuservices.com <jhersh%40euservices.com>>
> wrote:
> >
> > Adbulla,
> >
> > I am very interested as well because my
understanding of things you will
> > not be able to tell via JavaScript where the
control originated. The
> > issue is that at the point the JavaScript is
executing (on the client)
> > the master page and the content panels have been
merged. The final
> > markup is just html.
> >
> > That being said you could look at the auto
assigned id's (ex.
> > _ctl0:dlInventory:_ctl9:orderButton) to provide
some information about
> > the source of the control. The _ctl portion will
give you information
> > about what parent container held a control. The
problem is that I don't
> > know how to get any meaningful information from
the auto generated ID
> > other then to tell that there was a separation
between parent
> > containers.
> >
> > Hopefully this is a little helpful.
> >
> > _____
> >
> > From:
AspNetAnyQuestionIsOk@yahoogroups.com<AspNetAnyQuestionIs
Ok%40yahoogroups.com>
> <AspNetAnyQuestionIsOk%40yahoogroups.com>
> >
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com<AspNetAnyQu
estionIsOk%40yahoogroups.com>
> <AspNetAnyQuestionIsOk%40yahoogroups.com>]
> > On Behalf Of Abdulla Abd
> > Al Haq
> > Sent: Wednesday, January 31, 2007 4:15 AM
> > To: .net1 .net2
> > Subject: [AspNetAnyQuestionIsOk] UserControl And
MasterPage
> >
> > Hi Group,
> > How can i know by javaScript if my Webusercontrol
is in MasterPage or in
> > a regular page?
> > i.e I want to write JavaScript Switch Statement in
webusercontrol to
> > know if the usercontrol is in a masterpage then do
something and if the
> > usercontrol is in a regulare page do a nother
thing
> >
> > thanks in a dvanced
> >
> > ---------------------------------
> > Looking for earth-friendly autos?
> > Browse Top Cars by "Green Rating" at
Yahoo! Autos' Green Center.
> >
> > [Non-text portions of this message have been
removed]
> >
> > [Non-text portions of this message have been
removed]
> >
> >
> >
>
> --
> Dean Fiala
> Very Practical Software, Inc
> Now with Blogging...
> http://www.vpsw.com/blog
baby
> Microsoft MVP
>
> [Non-text portions of this message have been removed]
>
> ---------------------------------
> Access over 1 million songs - Yahoo! Music Unlimited.
>
> [Non-text portions of this message have been removed]
>
>  
>



-- 
Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.com/blog
baby
Microsoft MVP


[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/join

    (Yahoo! ID required)

<*> To change settings via email:
    mailto:AspNetAnyQuestionIsOk-digest@yahoogroups.com 
   
mailto:AspNetAnyQuestionIsOk-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.c
om/info/terms/
 

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )