Home All Groups Group Topic Archive Search About

Client ID of User Control in Page templates

Author
21 Jun 2006 4:34 PM
Nilay Shah
Hi,

I am coding in 1.1 framework.. And we have created Page Template classes
(the way Master Page works in 2.0) in 1.1 framework..  All the pages would
have code between follwoing tags.

<custom:pagebody id="pagebody" runat="server" templatepath=
"../PageTemplate.ascx">

.....

</custom:pagebody>

Because of this, all the control ids are rendered and names are changed once
page is loaded.  In my page, Page1.aspx, there is a user control UC1.ascx.
And I want to create the javascript dynamically in my parent page i.e.
Page1.aspx where in I want to get the client id of one of the control in
UC1.ascx.

I was trying to get Client ID and Build Javascript in Page_Load function of
my page.  But the client ID that I get on Page_load, gets modified because of
Page Template concept.

I am not able to find where should I build my dynamic JavaScript on parent
Page?

Please let me know,

Thanks,

Nilay.

Author
22 Jun 2006 9:13 PM
Phillip Williams
Instead of doing that during the page_load, do it while handling the
page.PreRender.
Show quoteHide quote
"Nilay Shah" wrote:

> Hi,
>
> I am coding in 1.1 framework.. And we have created Page Template classes
> (the way Master Page works in 2.0) in 1.1 framework..  All the pages would
> have code between follwoing tags.
>
> <custom:pagebody id="pagebody" runat="server" templatepath=
> "../PageTemplate.ascx">
>
> ....
>
> </custom:pagebody>
>
> Because of this, all the control ids are rendered and names are changed once
> page is loaded.  In my page, Page1.aspx, there is a user control UC1.ascx.
> And I want to create the javascript dynamically in my parent page i.e.
> Page1.aspx where in I want to get the client id of one of the control in
> UC1.ascx.
>
> I was trying to get Client ID and Build Javascript in Page_Load function of
> my page.  But the client ID that I get on Page_load, gets modified because of
> Page Template concept.
>
> I am not able to find where should I build my dynamic JavaScript on parent
> Page?
>
> Please let me know,
>
> Thanks,
>
> Nilay.
>
>
Author
23 Jun 2006 5:37 AM
Nilay Shah
Hi,

I think Page.PreRender is in .net 2.0 and not in 1.1... I am working in
1.1... and i am not able to find page.prerender event.. may be my MSDN is old
:) let me know if it is in 1.1

thanks,
nilay
Show quoteHide quote
"Phillip Williams" wrote:

> Instead of doing that during the page_load, do it while handling the
> page.PreRender.
> --
> HTH,
> Phillip Williams
> http://www.societopia.net
> http://www.webswapp.com
>
>
> "Nilay Shah" wrote:
>
> > Hi,
> >
> > I am coding in 1.1 framework.. And we have created Page Template classes
> > (the way Master Page works in 2.0) in 1.1 framework..  All the pages would
> > have code between follwoing tags.
> >
> > <custom:pagebody id="pagebody" runat="server" templatepath=
> > "../PageTemplate.ascx">
> >
> > ....
> >
> > </custom:pagebody>
> >
> > Because of this, all the control ids are rendered and names are changed once
> > page is loaded.  In my page, Page1.aspx, there is a user control UC1.ascx.
> > And I want to create the javascript dynamically in my parent page i.e.
> > Page1.aspx where in I want to get the client id of one of the control in
> > UC1.ascx.
> >
> > I was trying to get Client ID and Build Javascript in Page_Load function of
> > my page.  But the client ID that I get on Page_load, gets modified because of
> > Page Template concept.
> >
> > I am not able to find where should I build my dynamic JavaScript on parent
> > Page?
> >
> > Please let me know,
> >
> > Thanks,
> >
> > Nilay.
> >
> >
Author
23 Jun 2006 12:38 PM
Phillip Williams
Yes. It is available in asp.net 1.1
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuicontrolclassonprerendertopic.asp

Show quoteHide quote
"Nilay Shah" wrote:

> Hi,
>
> I think Page.PreRender is in .net 2.0 and not in 1.1... I am working in
> 1.1... and i am not able to find page.prerender event.. may be my MSDN is old
> :) let me know if it is in 1.1
>
> thanks,
> nilay
> "Phillip Williams" wrote:
>
> > Instead of doing that during the page_load, do it while handling the
> > page.PreRender.
> > --
> > HTH,
> > Phillip Williams
> > http://www.societopia.net
> > http://www.webswapp.com
> >
> >
> > "Nilay Shah" wrote:
> >
> > > Hi,
> > >
> > > I am coding in 1.1 framework.. And we have created Page Template classes
> > > (the way Master Page works in 2.0) in 1.1 framework..  All the pages would
> > > have code between follwoing tags.
> > >
> > > <custom:pagebody id="pagebody" runat="server" templatepath=
> > > "../PageTemplate.ascx">
> > >
> > > ....
> > >
> > > </custom:pagebody>
> > >
> > > Because of this, all the control ids are rendered and names are changed once
> > > page is loaded.  In my page, Page1.aspx, there is a user control UC1.ascx.
> > > And I want to create the javascript dynamically in my parent page i.e.
> > > Page1.aspx where in I want to get the client id of one of the control in
> > > UC1.ascx.
> > >
> > > I was trying to get Client ID and Build Javascript in Page_Load function of
> > > my page.  But the client ID that I get on Page_load, gets modified because of
> > > Page Template concept.
> > >
> > > I am not able to find where should I build my dynamic JavaScript on parent
> > > Page?
> > >
> > > Please let me know,
> > >
> > > Thanks,
> > >
> > > Nilay.
> > >
> > >