__doPostback method with colons problem

Discussion in 'ASP .Net' started by Steven Livingstone, Aug 4, 2003.

  1. I am running into the "colon in javascript" problem as discussed here
    http://www.bdragon.com/entries/000324.shtml.

    Basically, i have nested controls and get the error on a line such as :

    theform = document._ctl0:frmPage;

    I noticed a solution at
    http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    However, this seems like a heck of an overhead for every page!

    Has anyone got any updates on if/when and how this can be fixed without
    resorting to these kind of fixes? Seems a fairly fundamental problem to me,
    so hopefully it has already been fixed and i'm just missing some upgrade or
    hot fix!!

    thanks,
    Steven
    Steven Livingstone, Aug 4, 2003
    #1
    1. Advertising

  2. FWIW :

    I have discovered that the basic problem is that i have the FORM defined
    within a usercontrol.
    It then turns out that "ucForm" is referenced in the __doPostBack method as
    :

    theform = document._ctl0:ucForm;

    Fails in JavaScript :(

    Any fixes?

    "Steven Livingstone" <> wrote in message
    news:%...
    > I am running into the "colon in javascript" problem as discussed here
    > http://www.bdragon.com/entries/000324.shtml.
    >
    > Basically, i have nested controls and get the error on a line such as :
    >
    > theform = document._ctl0:frmPage;
    >
    > I noticed a solution at
    > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    > However, this seems like a heck of an overhead for every page!
    >
    > Has anyone got any updates on if/when and how this can be fixed without
    > resorting to these kind of fixes? Seems a fairly fundamental problem to

    me,
    > so hopefully it has already been fixed and i'm just missing some upgrade

    or
    > hot fix!!
    >
    > thanks,
    > Steven
    >
    >
    Steven Livingstone, Aug 4, 2003
    #2
    1. Advertising

  3. ok - 1 way around it i have found (based on an earlier uri).

    Override the render method in the control and replace ":" for control names
    with "_".

    Works thus far - anyone tried this and run into any probs?

    Still is not something i want to put into prod :S

    "Steven Livingstone" <> wrote in message
    news:%...
    > I am running into the "colon in javascript" problem as discussed here
    > http://www.bdragon.com/entries/000324.shtml.
    >
    > Basically, i have nested controls and get the error on a line such as :
    >
    > theform = document._ctl0:frmPage;
    >
    > I noticed a solution at
    > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    > However, this seems like a heck of an overhead for every page!
    >
    > Has anyone got any updates on if/when and how this can be fixed without
    > resorting to these kind of fixes? Seems a fairly fundamental problem to

    me,
    > so hopefully it has already been fixed and i'm just missing some upgrade

    or
    > hot fix!!
    >
    > thanks,
    > Steven
    >
    >
    Steven Livingstone, Aug 4, 2003
    #3
  4. Hi JD - I have actually written a framework which uses a core usercontrol to
    implement the look and feel any application and all it's (reusable) sub
    controls. I tried a whole host of ways, but this is the only way i can see
    it working and still be extensible.

    This main control hosts the other controls and the page acts as a simple
    container which the <form> wrapper in it. So that control itself is never
    reused outside its parent page.

    In other cases i may well write a full encapsulated "poll control" with the
    form element to be just dropped into any asp page. I don't in my case, but
    i'd like ASP.Net to support that possibility!

    Cheers,
    Steven.

    "JD" <> wrote in message
    news:05eb01c35a84$6277b0e0$...
    > The idea here is that you never declare a form within a
    > user control. When developing controls you should never
    > assume where your controls will or will not be used. In
    > your case what happens if someone wants to use your
    > control inside an existing form?
    >
    > - J
    >
    > >-----Original Message-----
    > >FWIW :
    > >
    > >I have discovered that the basic problem is that i have

    > the FORM defined
    > >within a usercontrol.
    > >It then turns out that "ucForm" is referenced in the

    > __doPostBack method as
    > >:
    > >
    > >theform = document._ctl0:ucForm;
    > >
    > >Fails in JavaScript :(
    > >
    > >Any fixes?
    > >
    > >"Steven Livingstone" <> wrote

    > in message
    > >news:%...
    > >> I am running into the "colon in javascript" problem as

    > discussed here
    > >> http://www.bdragon.com/entries/000324.shtml.
    > >>
    > >> Basically, i have nested controls and get the error on

    > a line such as :
    > >>
    > >> theform = document._ctl0:frmPage;
    > >>
    > >> I noticed a solution at
    > >> http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    > >> However, this seems like a heck of an overhead for

    > every page!
    > >>
    > >> Has anyone got any updates on if/when and how this can

    > be fixed without
    > >> resorting to these kind of fixes? Seems a fairly

    > fundamental problem to
    > >me,
    > >> so hopefully it has already been fixed and i'm just

    > missing some upgrade
    > >or
    > >> hot fix!!
    > >>
    > >> thanks,
    > >> Steven
    > >>
    > >>

    > >
    > >
    > >.
    > >
    Steven Livingstone, Aug 4, 2003
    #4
  5. Steven Livingstone

    vMike Guest

    You might try this. You may have to modify it a bit but I don't think the
    overhead is too bad.
    (Not my idea, but it works real well) I left some of the old code that I
    didn't need in there in case you need it. Hope this helps you.


    Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)

    Dim _stringBuilder As StringBuilder = New StringBuilder()
    Dim _stringWriter As StringWriter = New StringWriter(_stringBuilder)
    Dim _htmlWriter As HtmlTextWriter = New HtmlTextWriter(_stringWriter)
    MyBase.Render(_htmlWriter)
    'Dim html As String = _stringBuilder.ToString()
    Dim start As Integer = html.IndexOf("document._ctl1:_ctl0;")

    'Dim intend As Integer = 6 + start 'html.IndexOf("""", start)
    if start <> -1 then

    'Dim formID As String = html.Substring(start, intend - start)
    'Dim replace As String = formID.Replace(":", "_")
    html = html.Replace("document._ctl1:_ctl0", "document._ctl1__ctl0") ' you
    may need to change
    end if

    writer.Write(html)

    End Sub
    "Steven Livingstone" <> wrote in message
    news:%...
    > I am running into the "colon in javascript" problem as discussed here
    > http://www.bdragon.com/entries/000324.shtml.
    >
    > Basically, i have nested controls and get the error on a line such as :
    >
    > theform = document._ctl0:frmPage;
    >
    > I noticed a solution at
    > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    > However, this seems like a heck of an overhead for every page!
    >
    > Has anyone got any updates on if/when and how this can be fixed without
    > resorting to these kind of fixes? Seems a fairly fundamental problem to

    me,
    > so hopefully it has already been fixed and i'm just missing some upgrade

    or
    > hot fix!!
    >
    > thanks,
    > Steven
    >
    >
    vMike, Aug 4, 2003
    #5
  6. "Steven Livingstone" <> wrote in message
    news:%...
    > I am running into the "colon in javascript" problem as discussed here
    > http://www.bdragon.com/entries/000324.shtml.
    >
    > Basically, i have nested controls and get the error on a line such as :
    >
    > theform = document._ctl0:frmPage;
    >
    > I noticed a solution at
    > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    > However, this seems like a heck of an overhead for every page!
    >


    I'm curious, what part of that do you believe is a "lot of overhead"?
    --
    John Saunders
    Internet Engineer
    John Saunders, Aug 4, 2003
    #6
  7. Hi John - unfortunately i pointed to the wrong Q&A!!
    The one i meant to point you to was :
    http://msdn.microsoft.com/msdnmag/issues/02/11/WebQA/

    As you can see in that case, the PageParser() methods is a heck of an
    overhea for every page!

    Cheers,
    Steven

    "John Saunders" <> wrote in message
    news:...
    > "Steven Livingstone" <> wrote in message
    > news:%...
    > > I am running into the "colon in javascript" problem as discussed here
    > > http://www.bdragon.com/entries/000324.shtml.
    > >
    > > Basically, i have nested controls and get the error on a line such as :
    > >
    > > theform = document._ctl0:frmPage;
    > >
    > > I noticed a solution at
    > > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    > > However, this seems like a heck of an overhead for every page!
    > >

    >
    > I'm curious, what part of that do you believe is a "lot of overhead"?
    > --
    > John Saunders
    > Internet Engineer
    >
    >
    >
    >
    Steven Livingstone, Aug 5, 2003
    #7
  8. Hi Michael -

    thanks for your code. In fact it is very simialr to the solution i decided
    upon last night and it works great.
    I will compare yours to see if there is anything i should add :)

    Still a bit of a hit, but hopefully it will be fixed sometime soon.

    cheers,
    steven

    "vMike" <> wrote in message
    news:bgmh92$2nl$...
    > You might try this. You may have to modify it a bit but I don't think the
    > overhead is too bad.
    > (Not my idea, but it works real well) I left some of the old code that I
    > didn't need in there in case you need it. Hope this helps you.
    >
    >
    > Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
    >
    > Dim _stringBuilder As StringBuilder = New StringBuilder()
    > Dim _stringWriter As StringWriter = New StringWriter(_stringBuilder)
    > Dim _htmlWriter As HtmlTextWriter = New HtmlTextWriter(_stringWriter)
    > MyBase.Render(_htmlWriter)
    > 'Dim html As String = _stringBuilder.ToString()
    > Dim start As Integer = html.IndexOf("document._ctl1:_ctl0;")
    >
    > 'Dim intend As Integer = 6 + start 'html.IndexOf("""", start)
    > if start <> -1 then
    >
    > 'Dim formID As String = html.Substring(start, intend - start)
    > 'Dim replace As String = formID.Replace(":", "_")
    > html = html.Replace("document._ctl1:_ctl0", "document._ctl1__ctl0") ' you
    > may need to change
    > end if
    >
    > writer.Write(html)
    >
    > End Sub
    > "Steven Livingstone" <> wrote in message
    > news:%...
    > > I am running into the "colon in javascript" problem as discussed here
    > > http://www.bdragon.com/entries/000324.shtml.
    > >
    > > Basically, i have nested controls and get the error on a line such as :
    > >
    > > theform = document._ctl0:frmPage;
    > >
    > > I noticed a solution at
    > > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    > > However, this seems like a heck of an overhead for every page!
    > >
    > > Has anyone got any updates on if/when and how this can be fixed without
    > > resorting to these kind of fixes? Seems a fairly fundamental problem to

    > me,
    > > so hopefully it has already been fixed and i'm just missing some upgrade

    > or
    > > hot fix!!
    > >
    > > thanks,
    > > Steven
    > >
    > >

    >
    >
    Steven Livingstone, Aug 5, 2003
    #8
  9. Steven, I don't see anything about PageParser in that Q&A.
    --
    John Saunders
    Internet Engineer


    "Steven Livingstone" <> wrote in message
    news:...
    > Hi John - unfortunately i pointed to the wrong Q&A!!
    > The one i meant to point you to was :
    > http://msdn.microsoft.com/msdnmag/issues/02/11/WebQA/
    >
    > As you can see in that case, the PageParser() methods is a heck of an
    > overhea for every page!
    >
    > Cheers,
    > Steven
    >
    > "John Saunders" <> wrote in message
    > news:...
    > > "Steven Livingstone" <> wrote in message
    > > news:%...
    > > > I am running into the "colon in javascript" problem as discussed here
    > > > http://www.bdragon.com/entries/000324.shtml.
    > > >
    > > > Basically, i have nested controls and get the error on a line such as

    :
    > > >
    > > > theform = document._ctl0:frmPage;
    > > >
    > > > I noticed a solution at
    > > > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    > > > However, this seems like a heck of an overhead for every page!
    > > >

    > >
    > > I'm curious, what part of that do you believe is a "lot of overhead"?
    > > --
    > > John Saunders
    > > Internet Engineer
    > >
    > >
    > >
    > >

    >
    >
    John Saunders, Aug 5, 2003
    #9
  10. John, go to the second Q on that page and click the "Figure 1" link to view
    the code listing.

    "John Saunders" <> wrote in message
    news:...
    > Steven, I don't see anything about PageParser in that Q&A.
    > --
    > John Saunders
    > Internet Engineer
    >
    >
    > "Steven Livingstone" <> wrote in message
    > news:...
    > > Hi John - unfortunately i pointed to the wrong Q&A!!
    > > The one i meant to point you to was :
    > > http://msdn.microsoft.com/msdnmag/issues/02/11/WebQA/
    > >
    > > As you can see in that case, the PageParser() methods is a heck of an
    > > overhea for every page!
    > >
    > > Cheers,
    > > Steven
    > >
    > > "John Saunders" <> wrote in message
    > > news:...
    > > > "Steven Livingstone" <> wrote in message
    > > > news:%...
    > > > > I am running into the "colon in javascript" problem as discussed

    here
    > > > > http://www.bdragon.com/entries/000324.shtml.
    > > > >
    > > > > Basically, i have nested controls and get the error on a line such

    as
    > :
    > > > >
    > > > > theform = document._ctl0:frmPage;
    > > > >
    > > > > I noticed a solution at
    > > > > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    > > > > However, this seems like a heck of an overhead for every page!
    > > > >
    > > >
    > > > I'm curious, what part of that do you believe is a "lot of overhead"?
    > > > --
    > > > John Saunders
    > > > Internet Engineer
    > > >
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Steven Livingstone, Aug 5, 2003
    #10
  11. Ok, thanks, yes, that's too much overhead.
    --
    John Saunders
    Internet Engineer


    "Steven Livingstone" <> wrote in message
    news:...
    > John, go to the second Q on that page and click the "Figure 1" link to

    view
    > the code listing.
    >
    > "John Saunders" <> wrote in message
    > news:...
    > > Steven, I don't see anything about PageParser in that Q&A.
    > > --
    > > John Saunders
    > > Internet Engineer
    > >
    > >
    > > "Steven Livingstone" <> wrote in message
    > > news:...
    > > > Hi John - unfortunately i pointed to the wrong Q&A!!
    > > > The one i meant to point you to was :
    > > > http://msdn.microsoft.com/msdnmag/issues/02/11/WebQA/
    > > >
    > > > As you can see in that case, the PageParser() methods is a heck of an
    > > > overhea for every page!
    > > >
    > > > Cheers,
    > > > Steven
    > > >
    > > > "John Saunders" <> wrote in message
    > > > news:...
    > > > > "Steven Livingstone" <> wrote in message
    > > > > news:%...
    > > > > > I am running into the "colon in javascript" problem as discussed

    > here
    > > > > > http://www.bdragon.com/entries/000324.shtml.
    > > > > >
    > > > > > Basically, i have nested controls and get the error on a line such

    > as
    > > :
    > > > > >
    > > > > > theform = document._ctl0:frmPage;
    > > > > >
    > > > > > I noticed a solution at
    > > > > > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    > > > > > However, this seems like a heck of an overhead for every page!
    > > > > >
    > > > >
    > > > > I'm curious, what part of that do you believe is a "lot of

    overhead"?
    > > > > --
    > > > > John Saunders
    > > > > Internet Engineer
    > > > >
    > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    John Saunders, Aug 5, 2003
    #11
  12. Hello Steven,

    This happens when asp.net form is included into control in framework 1.1. It seems that this is not welcomed way to build
    webforms, but anyway sometimes this can be very useful. This must work on .net 1.0.

    The workaround now is to override control's holding <form> method Render, again, it is possible override Render method of
    page alltogether.

    Thanks.

    Best regards,
    Yanhong Huang
    Microsoft Online Partner Support

    Get Secure! - www.microsoft.com/security
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    !From: "Steven Livingstone" <>
    !References: <#> <>
    <> <>
    !Subject: Re: __doPostback method with colons problem
    !Date: Tue, 5 Aug 2003 15:02:16 +0100
    !Lines: 56
    !X-Priority: 3
    !X-MSMail-Priority: Normal
    !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    !Message-ID: <>
    !Newsgroups: microsoft.public.dotnet.framework.aspnet
    !NNTP-Posting-Host: 212.20.246.65
    !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
    !Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:164973
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    !
    !John, go to the second Q on that page and click the "Figure 1" link to view
    !the code listing.
    !
    !"John Saunders" <> wrote in message
    !news:...
    !> Steven, I don't see anything about PageParser in that Q&A.
    !> --
    !> John Saunders
    !> Internet Engineer
    !>
    !>
    !> "Steven Livingstone" <> wrote in message
    !> news:...
    !> > Hi John - unfortunately i pointed to the wrong Q&A!!
    !> > The one i meant to point you to was :
    !> > http://msdn.microsoft.com/msdnmag/issues/02/11/WebQA/
    !> >
    !> > As you can see in that case, the PageParser() methods is a heck of an
    !> > overhea for every page!
    !> >
    !> > Cheers,
    !> > Steven
    !> >
    !> > "John Saunders" <> wrote in message
    !> > news:...
    !> > > "Steven Livingstone" <> wrote in message
    !> > > news:%...
    !> > > > I am running into the "colon in javascript" problem as discussed
    !here
    !> > > > http://www.bdragon.com/entries/000324.shtml.
    !> > > >
    !> > > > Basically, i have nested controls and get the error on a line such
    !as
    !> :
    !> > > >
    !> > > > theform = document._ctl0:frmPage;
    !> > > >
    !> > > > I noticed a solution at
    !> > > > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    !> > > > However, this seems like a heck of an overhead for every page!
    !> > > >
    !> > >
    !> > > I'm curious, what part of that do you believe is a "lot of overhead"?
    !> > > --
    !> > > John Saunders
    !> > > Internet Engineer
    !> > >
    !> > >
    !> > >
    !> > >
    !> >
    !> >
    !>
    !>
    !
    !
    !
    Yan-Hong Huang[MSFT], Aug 6, 2003
    #12
  13. Actually, the workaround we use is to not use Framework 1.1.

    The fix would be for Microsoft to fix its bug. It would be just as easy to
    ignore the Netscape branch of that "if" statement (with a comment saying,
    "our bad: here's the stupid code we would have produced, we'll fix it soon,
    don't sue us") as to break our web sites for both Netscape and IE by
    treating the form name as an identifier (is it supposed to be an
    identifier?).
    --
    John Saunders
    Internet Engineer


    "Yan-Hong Huang[MSFT]" <> wrote in message
    news:YPblbJ$...
    > Hello Steven,
    >
    > This happens when asp.net form is included into control in framework 1.1.

    It seems that this is not welcomed way to build
    > webforms, but anyway sometimes this can be very useful. This must work on

    ..net 1.0.
    >
    > The workaround now is to override control's holding <form> method Render,

    again, it is possible override Render method of
    > page alltogether.
    >
    > Thanks.
    >
    > Best regards,
    > Yanhong Huang
    > Microsoft Online Partner Support
    >
    > Get Secure! - www.microsoft.com/security
    > This posting is provided "AS IS" with no warranties, and confers no

    rights.
    >
    > --------------------
    > !From: "Steven Livingstone" <>
    > !References: <#>

    <>
    > <>

    <>
    > !Subject: Re: __doPostback method with colons problem
    > !Date: Tue, 5 Aug 2003 15:02:16 +0100
    > !Lines: 56
    > !X-Priority: 3
    > !X-MSMail-Priority: Normal
    > !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    > !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    > !Message-ID: <>
    > !Newsgroups: microsoft.public.dotnet.framework.aspnet
    > !NNTP-Posting-Host: 212.20.246.65
    > !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
    > !Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet:164973
    > !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    > !
    > !John, go to the second Q on that page and click the "Figure 1" link to

    view
    > !the code listing.
    > !
    > !"John Saunders" <> wrote in message
    > !news:...
    > !> Steven, I don't see anything about PageParser in that Q&A.
    > !> --
    > !> John Saunders
    > !> Internet Engineer
    > !>
    > !>
    > !> "Steven Livingstone" <> wrote in message
    > !> news:...
    > !> > Hi John - unfortunately i pointed to the wrong Q&A!!
    > !> > The one i meant to point you to was :
    > !> > http://msdn.microsoft.com/msdnmag/issues/02/11/WebQA/
    > !> >
    > !> > As you can see in that case, the PageParser() methods is a heck of an
    > !> > overhea for every page!
    > !> >
    > !> > Cheers,
    > !> > Steven
    > !> >
    > !> > "John Saunders" <> wrote in message
    > !> > news:...
    > !> > > "Steven Livingstone" <> wrote in

    message
    > !> > > news:%...
    > !> > > > I am running into the "colon in javascript" problem as discussed
    > !here
    > !> > > > http://www.bdragon.com/entries/000324.shtml.
    > !> > > >
    > !> > > > Basically, i have nested controls and get the error on a line

    such
    > !as
    > !> :
    > !> > > >
    > !> > > > theform = document._ctl0:frmPage;
    > !> > > >
    > !> > > > I noticed a solution at
    > !> > > > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    > !> > > > However, this seems like a heck of an overhead for every page!
    > !> > > >
    > !> > >
    > !> > > I'm curious, what part of that do you believe is a "lot of

    overhead"?
    > !> > > --
    > !> > > John Saunders
    > !> > > Internet Engineer
    > !> > >
    > !> > >
    > !> > >
    > !> > >
    > !> >
    > !> >
    > !>
    > !>
    > !
    > !
    > !
    >
    >
    John Saunders, Aug 6, 2003
    #13
  14. Hello John,

    Yes, I agree with you. In fact, it has been logged into our internal
    database. We are working on it and it will be integrated into later version
    of Visual Studio.

    Thanks.

    Best regards,
    Yanhong Huang
    Microsoft Online Partner Support

    Get Secure! - www.microsoft.com/security
    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    !From: "John Saunders" <>
    !References: <#>
    <>
    <>
    <>
    <>
    <YPblbJ$>
    !Subject: Re: __doPostback method with colons problem
    !Date: Wed, 6 Aug 2003 12:00:13 -0400
    !Lines: 122
    !X-Priority: 3
    !X-MSMail-Priority: Normal
    !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    !Message-ID: <>
    !Newsgroups: microsoft.public.dotnet.framework.aspnet
    !NNTP-Posting-Host: pool-141-149-183-116.bos.east.verizon.net
    141.149.183.116
    !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
    !Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:165410
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    !
    !Actually, the workaround we use is to not use Framework 1.1.
    !
    !The fix would be for Microsoft to fix its bug. It would be just as easy to
    !ignore the Netscape branch of that "if" statement (with a comment saying,
    !"our bad: here's the stupid code we would have produced, we'll fix it soon,
    !don't sue us") as to break our web sites for both Netscape and IE by
    !treating the form name as an identifier (is it supposed to be an
    !identifier?).
    !--
    !John Saunders
    !Internet Engineer
    !
    !
    !"Yan-Hong Huang[MSFT]" <> wrote in message
    !news:YPblbJ$...
    !> Hello Steven,
    !>
    !> This happens when asp.net form is included into control in framework 1.1.
    !It seems that this is not welcomed way to build
    !> webforms, but anyway sometimes this can be very useful. This must work on
    !.net 1.0.
    !>
    !> The workaround now is to override control's holding <form> method Render,
    !again, it is possible override Render method of
    !> page alltogether.
    !>
    !> Thanks.
    !>
    !> Best regards,
    !> Yanhong Huang
    !> Microsoft Online Partner Support
    !>
    !> Get Secure! - www.microsoft.com/security
    !> This posting is provided "AS IS" with no warranties, and confers no
    !rights.
    !>
    !> --------------------
    !> !From: "Steven Livingstone" <>
    !> !References: <#>
    !<>
    !> <>
    !<>
    !> !Subject: Re: __doPostback method with colons problem
    !> !Date: Tue, 5 Aug 2003 15:02:16 +0100
    !> !Lines: 56
    !> !X-Priority: 3
    !> !X-MSMail-Priority: Normal
    !> !X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    !> !X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    !> !Message-ID: <>
    !> !Newsgroups: microsoft.public.dotnet.framework.aspnet
    !> !NNTP-Posting-Host: 212.20.246.65
    !> !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
    !> !Xref: cpmsftngxa06.phx.gbl
    !microsoft.public.dotnet.framework.aspnet:164973
    !> !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    !> !
    !> !John, go to the second Q on that page and click the "Figure 1" link to
    !view
    !> !the code listing.
    !> !
    !> !"John Saunders" <> wrote in message
    !> !news:...
    !> !> Steven, I don't see anything about PageParser in that Q&A.
    !> !> --
    !> !> John Saunders
    !> !> Internet Engineer
    !> !>
    !> !>
    !> !> "Steven Livingstone" <> wrote in message
    !> !> news:...
    !> !> > Hi John - unfortunately i pointed to the wrong Q&A!!
    !> !> > The one i meant to point you to was :
    !> !> > http://msdn.microsoft.com/msdnmag/issues/02/11/WebQA/
    !> !> >
    !> !> > As you can see in that case, the PageParser() methods is a heck of
    an
    !> !> > overhea for every page!
    !> !> >
    !> !> > Cheers,
    !> !> > Steven
    !> !> >
    !> !> > "John Saunders" <> wrote in message
    !> !> > news:...
    !> !> > > "Steven Livingstone" <> wrote in
    !message
    !> !> > > news:%...
    !> !> > > > I am running into the "colon in javascript" problem as discussed
    !> !here
    !> !> > > > http://www.bdragon.com/entries/000324.shtml.
    !> !> > > >
    !> !> > > > Basically, i have nested controls and get the error on a line
    !such
    !> !as
    !> !> :
    !> !> > > >
    !> !> > > > theform = document._ctl0:frmPage;
    !> !> > > >
    !> !> > > > I noticed a solution at
    !> !> > > > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    !> !> > > > However, this seems like a heck of an overhead for every page!
    !> !> > > >
    !> !> > >
    !> !> > > I'm curious, what part of that do you believe is a "lot of
    !overhead"?
    !> !> > > --
    !> !> > > John Saunders
    !> !> > > Internet Engineer
    !> !> > >
    !> !> > >
    !> !> > >
    !> !> > >
    !> !> >
    !> !> >
    !> !>
    !> !>
    !> !
    !> !
    !> !
    !>
    !>
    !
    !
    !
    Yan-Hong Huang[MSFT], Aug 11, 2003
    #14
  15. First off I have to say thanks for pointing out those
    articles, they helped me figure out the problem. I also
    tried what one of the links said, (smaller solution of
    name=id), but that still didn't work.

    I did however figure out a hack, and that's basically
    create the postback yourself.

    Remove the autopostback feature on your control, and
    instead add the onchange javascript yourself:
    frmShippingChargeType.Attributes.Add
    ("onchange", "doManualPostBack('_ctl1
    $frmShippingChargeType','')");

    within the .cs file.

    then create the two hidden fields that the post back uses:
    <input type="hidden" name="__EVENTTARGET"
    value="" />
    <input type="hidden"
    name="__EVENTARGUMENT" value="" />

    put these below your <form tag.

    Then, and this is the sketchy part is I made a modified
    dopostback method:

    <script language="javascript">
    <!--
    function doManualPostBack(eventTarget,
    eventArgument) {
    var theform;
    if (window.navigator.appName.toLowerCase
    ().indexOf("netscape") > -1) {
    theform = document.forms
    ["_ctl1:frmadminProduct"];
    }
    else {
    theform = document.forms[0];
    }
    theform.__EVENTTARGET.value =
    eventTarget.split("$").join(":");
    theform.__EVENTARGUMENT.value =
    eventArgument;
    theform.submit();
    }
    // -->
    </script>

    the key line to look at is:
    theform = document.forms[0];

    this takes the first form on the page and uses it. For
    what I'm doing now, that will work, though I don't know
    if it will always do the trick for everyone.

    However, with these things I've been able to do post
    backs and everything else seems to work as normal.

    >-----Original Message-----
    >Ok, thanks, yes, that's too much overhead.
    >--
    >John Saunders
    >Internet Engineer
    >
    >
    >"Steven Livingstone" <>

    wrote in message
    >news:...
    >> John, go to the second Q on that page and click

    the "Figure 1" link to
    >view
    >> the code listing.
    >>
    >> "John Saunders" <> wrote

    in message
    >> news:...
    >> > Steven, I don't see anything about PageParser in

    that Q&A.
    >> > --
    >> > John Saunders
    >> > Internet Engineer
    >> >
    >> >
    >> > "Steven Livingstone" <>

    wrote in message
    >> > news:...
    >> > > Hi John - unfortunately i pointed to the wrong

    Q&A!!
    >> > > The one i meant to point you to was :
    >> > >

    http://msdn.microsoft.com/msdnmag/issues/02/11/WebQA/
    >> > >
    >> > > As you can see in that case, the PageParser()

    methods is a heck of an
    >> > > overhea for every page!
    >> > >
    >> > > Cheers,
    >> > > Steven
    >> > >
    >> > > "John Saunders" <>

    wrote in message
    >> > > news:...
    >> > > > "Steven Livingstone"

    <> wrote in message
    >> > > > news:%...
    >> > > > > I am running into the "colon in javascript"

    problem as discussed
    >> here
    >> > > > > http://www.bdragon.com/entries/000324.shtml.
    >> > > > >
    >> > > > > Basically, i have nested controls and get the

    error on a line such
    >> as
    >> > :
    >> > > > >
    >> > > > > theform = document._ctl0:frmPage;
    >> > > > >
    >> > > > > I noticed a solution at
    >> > > > >

    http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    >> > > > > However, this seems like a heck of an overhead

    for every page!
    >> > > > >
    >> > > >
    >> > > > I'm curious, what part of that do you believe is

    a "lot of
    >overhead"?
    >> > > > --
    >> > > > John Saunders
    >> > > > Internet Engineer
    >> > > >
    >> > > >
    >> > > >
    >> > > >
    >> > >
    >> > >
    >> >
    >> >

    >>
    >>

    >
    >
    >.
    >
    David McCormack, Aug 28, 2003
    #15
  16. David, Thanks for the info.

    Doesn't ASP.NET still render its own, incorrect "doPostBack" script?
    --
    John Saunders
    Internet Engineer


    "David McCormack" <> wrote in message
    news:32e601c36cfe$5a6cab30$...
    > First off I have to say thanks for pointing out those
    > articles, they helped me figure out the problem. I also
    > tried what one of the links said, (smaller solution of
    > name=id), but that still didn't work.
    >
    > I did however figure out a hack, and that's basically
    > create the postback yourself.
    >
    > Remove the autopostback feature on your control, and
    > instead add the onchange javascript yourself:
    > frmShippingChargeType.Attributes.Add
    > ("onchange", "doManualPostBack('_ctl1
    > $frmShippingChargeType','')");
    >
    > within the .cs file.
    >
    > then create the two hidden fields that the post back uses:
    > <input type="hidden" name="__EVENTTARGET"
    > value="" />
    > <input type="hidden"
    > name="__EVENTARGUMENT" value="" />
    >
    > put these below your <form tag.
    >
    > Then, and this is the sketchy part is I made a modified
    > dopostback method:
    >
    > <script language="javascript">
    > <!--
    > function doManualPostBack(eventTarget,
    > eventArgument) {
    > var theform;
    > if (window.navigator.appName.toLowerCase
    > ().indexOf("netscape") > -1) {
    > theform = document.forms
    > ["_ctl1:frmadminProduct"];
    > }
    > else {
    > theform = document.forms[0];
    > }
    > theform.__EVENTTARGET.value =
    > eventTarget.split("$").join(":");
    > theform.__EVENTARGUMENT.value =
    > eventArgument;
    > theform.submit();
    > }
    > // -->
    > </script>
    >
    > the key line to look at is:
    > theform = document.forms[0];
    >
    > this takes the first form on the page and uses it. For
    > what I'm doing now, that will work, though I don't know
    > if it will always do the trick for everyone.
    >
    > However, with these things I've been able to do post
    > backs and everything else seems to work as normal.
    >
    > >-----Original Message-----
    > >Ok, thanks, yes, that's too much overhead.
    > >--
    > >John Saunders
    > >Internet Engineer
    > >
    > >
    > >"Steven Livingstone" <>

    > wrote in message
    > >news:...
    > >> John, go to the second Q on that page and click

    > the "Figure 1" link to
    > >view
    > >> the code listing.
    > >>
    > >> "John Saunders" <> wrote

    > in message
    > >> news:...
    > >> > Steven, I don't see anything about PageParser in

    > that Q&A.
    > >> > --
    > >> > John Saunders
    > >> > Internet Engineer
    > >> >
    > >> >
    > >> > "Steven Livingstone" <>

    > wrote in message
    > >> > news:...
    > >> > > Hi John - unfortunately i pointed to the wrong

    > Q&A!!
    > >> > > The one i meant to point you to was :
    > >> > >

    > http://msdn.microsoft.com/msdnmag/issues/02/11/WebQA/
    > >> > >
    > >> > > As you can see in that case, the PageParser()

    > methods is a heck of an
    > >> > > overhea for every page!
    > >> > >
    > >> > > Cheers,
    > >> > > Steven
    > >> > >
    > >> > > "John Saunders" <>

    > wrote in message
    > >> > > news:...
    > >> > > > "Steven Livingstone"

    > <> wrote in message
    > >> > > > news:%...
    > >> > > > > I am running into the "colon in javascript"

    > problem as discussed
    > >> here
    > >> > > > > http://www.bdragon.com/entries/000324.shtml.
    > >> > > > >
    > >> > > > > Basically, i have nested controls and get the

    > error on a line such
    > >> as
    > >> > :
    > >> > > > >
    > >> > > > > theform = document._ctl0:frmPage;
    > >> > > > >
    > >> > > > > I noticed a solution at
    > >> > > > >

    > http://msdn.microsoft.com/msdnmag/issues/02/10/WebQA/
    > >> > > > > However, this seems like a heck of an overhead

    > for every page!
    > >> > > > >
    > >> > > >
    > >> > > > I'm curious, what part of that do you believe is

    > a "lot of
    > >overhead"?
    > >> > > > --
    > >> > > > John Saunders
    > >> > > > Internet Engineer
    > >> > > >
    > >> > > >
    > >> > > >
    > >> > > >
    > >> > >
    > >> > >
    > >> >
    > >> >
    > >>
    > >>

    > >
    > >
    > >.
    > >
    John Saunders, Aug 28, 2003
    #16
    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. Grant Robertson

    Multiple colons in namespace names?

    Grant Robertson, Jan 13, 2007, in forum: XML
    Replies:
    6
    Views:
    656
    Joe Kesselman
    Jan 15, 2007
  2. Paddy
    Replies:
    2
    Views:
    248
    Neil Cerutti
    Jan 9, 2007
  3. Paddy
    Replies:
    9
    Views:
    288
    Hendrik van Rooyen
    Jan 10, 2007
  4. Québec
    Replies:
    6
    Views:
    130
    Thomas 'PointedEars' Lahn
    Nov 17, 2003
  5. double colons in Javascript

    , Jul 25, 2007, in forum: Javascript
    Replies:
    2
    Views:
    89
    Erik Langhout
    Jul 25, 2007
Loading...

Share This Page