473,386 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

__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 1937
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Alex Lein | last post by:
I've got a series of 3 drop down menus that validate my form. on my local win2k machine, the script works fine. When i upload it to my win2k3 production server, the __doPostBack function...
0
by: Frankieboy | last post by:
Where is __doPostBack-function defined? I've got an application which generates a different __doPostBack-function when the code is being run on the server compared to the one on my laptop. The...
1
by: paul reed | last post by:
Hello, I am having some weird behavior between two machines...one which is running the 1.1 framework and one which is running 1.0. After opening a child form from a parent...I update the...
3
by: E | last post by:
I have 2 aspx pages... neither of which do anything out of the ordinary. One of the pages automatically generates this block of code when viewed at the client:...
1
by: Adrian | last post by:
I appear to be losing ViewState information when calling the __doPostBack function. I am attempting to use the showModalDialog to load a new web page which confirms that a user wishes to save a...
0
by: Granger Godbold | last post by:
This is in regards to the long-standing bug with the colons in the form-id. I'm not satisfied with the main workaround that's been circulating: http://www.asp.net/Forums/ShowPost.aspx?PostID=191953...
3
by: Marcelo | last post by:
Hello, I am trying to create a postback event, and it is working, just not calling the sub. I have a datagrid which has <asp:DataGrid id="Mensajes" ... <Columns> <asp:HyperLinkColumn ....
0
by: Steve Richter | last post by:
ok, I admit I dont know what I am doing ... When a user clicks on a <tr> in a <table> I want the page to be posted back to the server with info as to what row was clicked. <tr...
2
by: SteveSu | last post by:
Hi! I want to make a postback when the user hits the escape-button on the keyboard and redirect the user to another page. But the response.redirect does not work for me in this "context". I´m...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.