469,572 Members | 1,336 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,572 developers. It's quick & easy.

__doPostback method with colons problem

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
Nov 17 '05 #1
15 1723
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" <s.***********@btinternet.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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

Nov 17 '05 #2
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" <s.***********@btinternet.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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

Nov 17 '05 #3
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" <no@where.com> wrote in message
news:05****************************@phx.gbl...
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" <s.***********@btinternet.com> wrote

in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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

.

Nov 17 '05 #4
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" <s.***********@btinternet.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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

Nov 17 '05 #5
"Steven Livingstone" <s.***********@btinternet.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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
jo***********@surfcontrol.com

Nov 17 '05 #6
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" <jo***********@surfcontrol.com> wrote in message
news:ua**************@TK2MSFTNGP12.phx.gbl...
"Steven Livingstone" <s.***********@btinternet.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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
jo***********@surfcontrol.com

Nov 17 '05 #7
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" <Mi************@nospam.gewarren.com.delete> wrote in message
news:bg**********@ngspool-d02.news.aol.com...
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" <s.***********@btinternet.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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


Nov 17 '05 #8
Steven, I don't see anything about PageParser in that Q&A.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

"Steven Livingstone" <s.***********@btinternet.com> wrote in message
news:uK**************@tk2msftngp13.phx.gbl...
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" <jo***********@surfcontrol.com> wrote in message
news:ua**************@TK2MSFTNGP12.phx.gbl...
"Steven Livingstone" <s.***********@btinternet.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
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
jo***********@surfcontrol.com


Nov 17 '05 #9
John, go to the second Q on that page and click the "Figure 1" link to view
the code listing.

"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:em**************@TK2MSFTNGP11.phx.gbl...
Steven, I don't see anything about PageParser in that Q&A.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

"Steven Livingstone" <s.***********@btinternet.com> wrote in message
news:uK**************@tk2msftngp13.phx.gbl...
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" <jo***********@surfcontrol.com> wrote in message
news:ua**************@TK2MSFTNGP12.phx.gbl...
"Steven Livingstone" <s.***********@btinternet.com> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
> 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
jo***********@surfcontrol.com



Nov 17 '05 #10
Ok, thanks, yes, that's too much overhead.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

"Steven Livingstone" <s.***********@btinternet.com> wrote in message
news:OZ**************@TK2MSFTNGP10.phx.gbl...
John, go to the second Q on that page and click the "Figure 1" link to view the code listing.

"John Saunders" <jo***********@surfcontrol.com> wrote in message
news:em**************@TK2MSFTNGP11.phx.gbl...
Steven, I don't see anything about PageParser in that Q&A.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

"Steven Livingstone" <s.***********@btinternet.com> wrote in message
news:uK**************@tk2msftngp13.phx.gbl...
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" <jo***********@surfcontrol.com> wrote in message
news:ua**************@TK2MSFTNGP12.phx.gbl...
> "Steven Livingstone" <s.***********@btinternet.com> wrote in message
> news:%2***************@TK2MSFTNGP10.phx.gbl...
> > 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
> jo***********@surfcontrol.com
>
>
>



Nov 17 '05 #11
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" <s.***********@btinternet.com>
!References: <#N*************@TK2MSFTNGP10.phx.gbl> <ua**************@TK2MSFTNGP12.phx.gbl>
<uK**************@tk2msftngp13.phx.gbl> <em**************@TK2MSFTNGP11.phx.gbl>
!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: <OZ**************@TK2MSFTNGP10.phx.gbl>
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!NNTP-Posting-Host: 212.20.246.65
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.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" <jo***********@surfcontrol.com> wrote in message
!news:em**************@TK2MSFTNGP11.phx.gbl...
!> Steven, I don't see anything about PageParser in that Q&A.
!> --
!> John Saunders
!> Internet Engineer
!> jo***********@surfcontrol.com
!>
!> "Steven Livingstone" <s.***********@btinternet.com> wrote in message
!> news:uK**************@tk2msftngp13.phx.gbl...
!> > 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" <jo***********@surfcontrol.com> wrote in message
!> > news:ua**************@TK2MSFTNGP12.phx.gbl...
!> > > "Steven Livingstone" <s.***********@btinternet.com> wrote in message
!> > > news:%2***************@TK2MSFTNGP10.phx.gbl...
!> > > > 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
!> > > jo***********@surfcontrol.com
!> > >
!> > >
!> > >
!> >
!> >
!>
!>
!
!
!
Nov 17 '05 #12
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
jo***********@surfcontrol.com

"Yan-Hong Huang[MSFT]" <yh*****@online.microsoft.com> wrote in message
news:YP**************@cpmsftngxa06.phx.gbl...
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" <s.***********@btinternet.com>
!References: <#N*************@TK2MSFTNGP10.phx.gbl> <ua**************@TK2MSFTNGP12.phx.gbl> <uK**************@tk2msftngp13.phx.gbl> <em**************@TK2MSFTNGP11.phx.gbl> !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: <OZ**************@TK2MSFTNGP10.phx.gbl>
!Newsgroups: microsoft.public.dotnet.framework.aspnet
!NNTP-Posting-Host: 212.20.246.65
!Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.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" <jo***********@surfcontrol.com> wrote in message
!news:em**************@TK2MSFTNGP11.phx.gbl...
!> Steven, I don't see anything about PageParser in that Q&A.
!> --
!> John Saunders
!> Internet Engineer
!> jo***********@surfcontrol.com
!>
!> "Steven Livingstone" <s.***********@btinternet.com> wrote in message
!> news:uK**************@tk2msftngp13.phx.gbl...
!> > 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" <jo***********@surfcontrol.com> wrote in message
!> > news:ua**************@TK2MSFTNGP12.phx.gbl...
!> > > "Steven Livingstone" <s.***********@btinternet.com> wrote in message !> > > news:%2***************@TK2MSFTNGP10.phx.gbl...
!> > > > 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
!> > > jo***********@surfcontrol.com
!> > >
!> > >
!> > >
!> >
!> >
!>
!>
!
!
!

Nov 17 '05 #13
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" <jo***********@surfcontrol.com>
!References: <#N*************@TK2MSFTNGP10.phx.gbl>
<ua**************@TK2MSFTNGP12.phx.gbl>
<uK**************@tk2msftngp13.phx.gbl>
<em**************@TK2MSFTNGP11.phx.gbl>
<OZ**************@TK2MSFTNGP10.phx.gbl>
<YP**************@cpmsftngxa06.phx.gbl>
!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: <Oi**************@tk2msftngp13.phx.gbl>
!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!tk2msftn gp13.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
!jo***********@surfcontrol.com
!
!"Yan-Hong Huang[MSFT]" <yh*****@online.microsoft.com> wrote in message
!news:YP**************@cpmsftngxa06.phx.gbl...
!> 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" <s.***********@btinternet.com>
!> !References: <#N*************@TK2MSFTNGP10.phx.gbl>
!<ua**************@TK2MSFTNGP12.phx.gbl>
!> <uK**************@tk2msftngp13.phx.gbl>
!<em**************@TK2MSFTNGP11.phx.gbl>
!> !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: <OZ**************@TK2MSFTNGP10.phx.gbl>
!> !Newsgroups: microsoft.public.dotnet.framework.aspnet
!> !NNTP-Posting-Host: 212.20.246.65
!> !Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.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" <jo***********@surfcontrol.com> wrote in message
!> !news:em**************@TK2MSFTNGP11.phx.gbl...
!> !> Steven, I don't see anything about PageParser in that Q&A.
!> !> --
!> !> John Saunders
!> !> Internet Engineer
!> !> jo***********@surfcontrol.com
!> !>
!> !> "Steven Livingstone" <s.***********@btinternet.com> wrote in message
!> !> news:uK**************@tk2msftngp13.phx.gbl...
!> !> > 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" <jo***********@surfcontrol.com> wrote in message
!> !> > news:ua**************@TK2MSFTNGP12.phx.gbl...
!> !> > > "Steven Livingstone" <s.***********@btinternet.com> wrote in
!message
!> !> > > news:%2***************@TK2MSFTNGP10.phx.gbl...
!> !> > > > 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
!> !> > > jo***********@surfcontrol.com
!> !> > >
!> !> > >
!> !> > >
!> !> >
!> !> >
!> !>
!> !>
!> !
!> !
!> !
!>
!>
!
!
!

Nov 17 '05 #14
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
jo***********@surfcontrol.com

"Steven Livingstone" <s.***********@btinternet.com> wrote in messagenews:OZ**************@TK2MSFTNGP10.phx.gbl...
John, go to the second Q on that page and click the "Figure 1" link to
view
the code listing.

"John Saunders" <jo***********@surfcontrol.com> wrote in message news:em**************@TK2MSFTNGP11.phx.gbl...
> Steven, I don't see anything about PageParser in that Q&A. > --
> John Saunders
> Internet Engineer
> jo***********@surfcontrol.com
>
> "Steven Livingstone" <s.***********@btinternet.com> wrote in message > news:uK**************@tk2msftngp13.phx.gbl...
> > 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" <jo***********@surfcontrol.com> wrote in message > > news:ua**************@TK2MSFTNGP12.phx.gbl...
> > > "Steven Livingstone" <s.***********@btinternet.com> wrote in message > > > news:%2***************@TK2MSFTNGP10.phx.gbl...
> > > > 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 ofoverhead"? > > > --
> > > John Saunders
> > > Internet Engineer
> > > jo***********@surfcontrol.com
> > >
> > >
> > >
> >
> >
>
>


.

Nov 17 '05 #15
David, Thanks for the info.

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

"David McCormack" <xe******@yahoo.com> wrote in message
news:32****************************@phx.gbl...
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
jo***********@surfcontrol.com

"Steven Livingstone" <s.***********@btinternet.com>

wrote in message
news:OZ**************@TK2MSFTNGP10.phx.gbl...
John, go to the second Q on that page and click the "Figure 1" link to
view
the code listing.

"John Saunders" <jo***********@surfcontrol.com> wrote

in message news:em**************@TK2MSFTNGP11.phx.gbl...
> Steven, I don't see anything about PageParser in that Q&A. > --
> John Saunders
> Internet Engineer
> jo***********@surfcontrol.com
>
> "Steven Livingstone" <s.***********@btinternet.com> wrote in message > news:uK**************@tk2msftngp13.phx.gbl...
> > 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" <jo***********@surfcontrol.com> wrote in message > > news:ua**************@TK2MSFTNGP12.phx.gbl...
> > > "Steven Livingstone" <s.***********@btinternet.com> wrote in message > > > news:%2***************@TK2MSFTNGP10.phx.gbl...
> > > > 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
> > > jo***********@surfcontrol.com
> > >
> > >
> > >
> >
> >
>
>

.

Nov 17 '05 #16

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Alex Lein | last post: by
reply views Thread by Frankieboy | last post: by
1 post views Thread by paul reed | last post: by
reply views Thread by Granger Godbold | last post: by
3 posts views Thread by Marcelo | last post: by
reply views Thread by Steve Richter | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.