473,608 Members | 1,809 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

__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 1955
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******** *******@TK2MSFT NGP10.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******** *******@TK2MSFT NGP10.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******* ********@TK2MSF TNGP10.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(_s tringBuilder)
Dim _htmlWriter As HtmlTextWriter = New HtmlTextWriter( _stringWriter)
MyBase.Render(_ htmlWriter)
'Dim html As String = _stringBuilder. ToString()
Dim start As Integer = html.IndexOf("d ocument._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("d ocument._ctl1:_ ctl0", "document._ctl1 __ctl0") ' you
may need to change
end if

writer.Write(ht ml)

End Sub
"Steven Livingstone" <s.***********@ btinternet.com> wrote in message
news:%2******** *******@TK2MSFT NGP10.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******** *******@TK2MSFT NGP10.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***********@s urfcontrol.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******** ******@TK2MSFTN GP12.phx.gbl...
"Steven Livingstone" <s.***********@ btinternet.com> wrote in message
news:%2******** *******@TK2MSFT NGP10.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***********@s urfcontrol.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.gewarre n.com.delete> wrote in message
news:bg******** **@ngspool-d02.news.aol.co m...
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(_s tringBuilder)
Dim _htmlWriter As HtmlTextWriter = New HtmlTextWriter( _stringWriter)
MyBase.Render(_ htmlWriter)
'Dim html As String = _stringBuilder. ToString()
Dim start As Integer = html.IndexOf("d ocument._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("d ocument._ctl1:_ ctl0", "document._ctl1 __ctl0") ' you
may need to change
end if

writer.Write(ht ml)

End Sub
"Steven Livingstone" <s.***********@ btinternet.com> wrote in message
news:%2******** *******@TK2MSFT NGP10.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***********@s urfcontrol.com

"Steven Livingstone" <s.***********@ btinternet.com> wrote in message
news:uK******** ******@tk2msftn gp13.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******** ******@TK2MSFTN GP12.phx.gbl...
"Steven Livingstone" <s.***********@ btinternet.com> wrote in message
news:%2******** *******@TK2MSFT NGP10.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***********@s urfcontrol.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******** ******@TK2MSFTN GP11.phx.gbl...
Steven, I don't see anything about PageParser in that Q&A.
--
John Saunders
Internet Engineer
jo***********@s urfcontrol.com

"Steven Livingstone" <s.***********@ btinternet.com> wrote in message
news:uK******** ******@tk2msftn gp13.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******** ******@TK2MSFTN GP12.phx.gbl...
"Steven Livingstone" <s.***********@ btinternet.com> wrote in message
news:%2******** *******@TK2MSFT NGP10.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***********@s urfcontrol.com



Nov 17 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
389
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 generates errors its giving me for element names with colons (":") in it. its trying to reference "mkn:header:navigation.dropdown1" Ive found the problem in MSDN, its a problem with ASP.NET the hotfix rollup from this article is what i need:
0
1527
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 version on server generates a script-error in the __doPostBack, while it runs without any problem on my developer-machine. The server is a Windows 2003 Server Standard Edition, while my developer machine is Windows XP Professional. Visual...
1
6800
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 database then call the __doPostBack function of the window.opener. This has been working like a charm for the last several months. Our ISP where we run the .NET app recently upgraded to 1.1 of the framework. When I run my app at the ISP...the...
3
10867
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: ------------------------------------------------------------ <form name="webfrmForm" method="post" action="pokedex.aspx" id="webfrmForm"> <input type="hidden" name="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" value="" /> <input type="hidden"...
1
2483
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 query. The showModalDailog returns a value to the original page which is used as a parameter in __doPostback, in turn trapped by the Page_Load procedure and processed.
0
1245
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 And I'm rather annoyed that Microsoft won't put the fix out for anonymous download (However, one can get to it from links in the above forum). http://support.microsoft.com/default.aspx?scid=kb;en-us;818058 Anyhow, after playing around, I found...
3
2981
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
1909
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 style="background-color:ffecd8" onmouseover="this.style.backgroundColor='#ffdcff';" onmouseout="this.style.backgroundColor='#ffecd8';" onclick="javascript:__doPostBack('row1')">
2
3916
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 trying to do like this: <body onkeydown="MyRedirect()">
0
8011
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8503
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8488
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8160
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8358
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6826
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2479
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.