Client ID of User Control in Page templates

Discussion in 'ASP .Net Web Controls' started by Nilay Shah, Jun 21, 2006.

  1. Nilay Shah

    Nilay Shah Guest

    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.
     
    Nilay Shah, Jun 21, 2006
    #1
    1. Advertising

  2. 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.
    >
    >
     
    Phillip Williams, Jun 22, 2006
    #2
    1. Advertising

  3. Nilay Shah

    Nilay Shah Guest

    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.
    > >
    > >
     
    Nilay Shah, Jun 23, 2006
    #3
  4. Yes. It is available in asp.net 1.1

    http://msdn.microsoft.com/library/d...rfsystemwebuicontrolclassonprerendertopic.asp

    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "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.
    > > >
    > > >
     
    Phillip Williams, Jun 23, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mad Scientist Jr
    Replies:
    0
    Views:
    676
    Mad Scientist Jr
    Mar 22, 2006
  2. JKop
    Replies:
    3
    Views:
    522
  3. recover
    Replies:
    2
    Views:
    858
    recover
    Jul 25, 2006
  4. Jonathan Wood

    User Control to Control Other User Control

    Jonathan Wood, Jan 24, 2010, in forum: ASP .Net
    Replies:
    4
    Views:
    582
    Jonathan Wood
    Feb 2, 2010
  5. Kiran More
    Replies:
    2
    Views:
    340
    Kiran More
    Nov 14, 2006
Loading...

Share This Page