Name generation issues between 2000 Server and 2003 server

Discussion in 'ASP .Net' started by Darren, Sep 22, 2006.

  1. Darren

    Darren Guest

    Not sure if this has been covered before.......


    I have an issue with an asp.net application running on Windows 2000
    server and Windows 2003 server:-

    The name generation of html objects (ie input buttons etc) is
    different between the 2 environments, even though both are running
    ..net v2.0.50727


    2000 Server generates of the form:-

    objSearchList:grdData:_ctl2:_ctl4


    but 2003 server generates:-

    objSearchList$grdData$ctl02$ctl04


    As the working environment is no longer consistent it is no longer
    possible to write dynamic javascripts for client-side validation.


    We have plenty of customers still working with 2000 server, so
    upgrading to 2003 server is not a solution.



    Can anyone shed any more light on this?
     
    Darren, Sep 22, 2006
    #1
    1. Advertising

  2. I wish I had more time to find an URL to help through this. If I understand
    the problem correctly, you are writing JavaScript in the page, as
    JavaScript, and linking to names you expect to be there. But, they are
    generated differently on different versions of windows, so your JavaScript
    points to non-existent controls.

    You are wondering how you can get past this. One option, that you might have
    thought of, is looping through the controls in JavaScript until you find the
    right one, but you know that is not a good performance option. So, you want
    to know how to get the proper name for the control on both environments.

    If I have the above correct ...

    You can still write dynamic Javascript (the key here being dynamic) on both
    systems with the same code. But, you have to do it in codebehind and either
    write the JavaScript out in a literal or emit the JavaScript. The
    methodology is writing by asking the conrols what their page name is or what
    Postback event they fire, etc.

    The best way to get versed in this is to cull through the material on
    EmitClientScript etc., along with a thorough review of the control
    architecture, paying esp. close attention to the properties common to
    controls that allow you to get client side names, etc. for the controls.

    There is a lot of information in the controls, but, unfortunately, not a lot
    of information about how to use it. As soon as you step out of the tiny box
    MS has painted, you have to head out into the wilderness alone. Or, so it
    seems.

    I will see if I get some time at lunch to get a link for this, or cull
    through some code and blog about it.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    http://gregorybeamer.spaces.live.com

    *************************************************
    Think outside of the box!
    *************************************************
    "Darren" <> wrote in message
    news:...
    > Not sure if this has been covered before.......
    >
    >
    > I have an issue with an asp.net application running on Windows 2000
    > server and Windows 2003 server:-
    >
    > The name generation of html objects (ie input buttons etc) is
    > different between the 2 environments, even though both are running
    > .net v2.0.50727
    >
    >
    > 2000 Server generates of the form:-
    >
    > objSearchList:grdData:_ctl2:_ctl4
    >
    >
    > but 2003 server generates:-
    >
    > objSearchList$grdData$ctl02$ctl04
    >
    >
    > As the working environment is no longer consistent it is no longer
    > possible to write dynamic javascripts for client-side validation.
    >
    >
    > We have plenty of customers still working with 2000 server, so
    > upgrading to 2003 server is not a solution.
    >
    >
    >
    > Can anyone shed any more light on this?
    >
    >
    >
    >
    >
    >
    >
     
    Cowboy \(Gregory A. Beamer\), Sep 22, 2006
    #2
    1. Advertising

  3. Darren

    cowznofsky Guest

    As noted in the other repy, you are coding to the name you expect to be
    generated.
    But are you sure that the generated name is not available at the time
    you're creating your script?
    My situation: I had a user control with a list box. I needed the
    generated name of the listbox, so I created a property in the code
    behind that would get the lstBox.ClientID.
    I was able to reference this property in javascript at the top of the
    user control, using
    window.document.forms[0][<% = lstBoxID %>]



    Darren wrote:
    > Not sure if this has been covered before.......
    >
    >
    > I have an issue with an asp.net application running on Windows 2000
    > server and Windows 2003 server:-
    >
    > The name generation of html objects (ie input buttons etc) is
    > different between the 2 environments, even though both are running
    > .net v2.0.50727
    >
    >
    > 2000 Server generates of the form:-
    >
    > objSearchList:grdData:_ctl2:_ctl4
    >
    >
    > but 2003 server generates:-
    >
    > objSearchList$grdData$ctl02$ctl04
    >
    >
    > As the working environment is no longer consistent it is no longer
    > possible to write dynamic javascripts for client-side validation.
    >
    >
    > We have plenty of customers still working with 2000 server, so
    > upgrading to 2003 server is not a solution.
    >
    >
    >
    > Can anyone shed any more light on this?
     
    cowznofsky, Sep 22, 2006
    #3
  4. Darren

    Darren Guest

    Thanks for the replies.

    You've both given me some ideas, so I'll re-code a few sections.


    Thanks
    Darren
     
    Darren, Sep 25, 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. =?Utf-8?B?Z2F1cmF2?=

    Uploading Data From MS Acess 2000 ti SQL server 2000

    =?Utf-8?B?Z2F1cmF2?=, Jan 9, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    816
    Mary Chipman [MSFT]
    Jan 9, 2006
  2. Vaap
    Replies:
    2
    Views:
    1,183
  3. C Did
    Replies:
    3
    Views:
    3,969
    Chris Lithgow
    Jun 20, 2006
  4. Adhik
    Replies:
    1
    Views:
    242
    Manohar Kamath [MVP]
    Sep 5, 2003
  5. Denis

    Access 2000 or SQL Server 2000

    Denis, Jan 25, 2004, in forum: ASP General
    Replies:
    1
    Views:
    210
    Nicole Calinoiu
    Jan 25, 2004
Loading...

Share This Page