473,587 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

__doPostBack code block not being generated by asp.net page

E
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="webfrmFor m" method="post" action="pokedex .aspx" id="webfrmForm" >
<input type="hidden" name="__EVENTTA RGET" value="" />
<input type="hidden" name="__EVENTAR GUMENT" value="" />
<input type="hidden" name="__VIEWSTA TE" value="[extensive data]" />

<script language="javas cript">
<!--
function __doPostBack(ev entTarget, eventArgument) {
var theform = document.forms["webfrmForm "];
theform.__EVENT TARGET.value = eventTarget.rep lace(/\$/g, ":");
theform.__EVENT ARGUMENT.value = eventArgument;
theform.submit( );
}
// -->
</script>
------------------------------------------------------------

The other asp page generates only this:

------------------------------------------------------------
<form name="wfrmPoked at" method="post" action="pokedat .aspx"
id="wfrmPokedat ">
<input type="hidden" name="__VIEWSTA TE" value="[data]" />
------------------------------------------------------------

The net result is that the first page can have objects onclick perform a
__doPostBack, and the other page throws a javascript error about an expected
object; and rightfully so, the __dopostback routine isn't there. But why
isn't it?

What triggers the asp.net creation of the __doPostBack code block? It's
also missing it's __EVENTTARGET and __EVENTARGUMENT hidden values. I can't
find any significant differences in either of my pages that would cause
this. I'm using framework 1.1 and 2003 rc2/iis6 server & notepad as an
editor.
Nov 17 '05 #1
3 10865
E
I discovered that the difference between the pages was a combo box on the
first page had the autopostback property of true, whereas the other page did
not have this poperty specified at all. Setting this property to true on
the second page caused asp.net to auto-generate the postback block I was
looking for.

How else can I get asp.net to generate this block? I don't want my combo
box on the second page to autopostback...
"E" <e@noreply.co m> wrote in message
news:1E******** ************@sp eakeasy.net...
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="webfrmFor m" method="post" action="pokedex .aspx" id="webfrmForm" > <input type="hidden" name="__EVENTTA RGET" value="" />
<input type="hidden" name="__EVENTAR GUMENT" value="" />
<input type="hidden" name="__VIEWSTA TE" value="[extensive data]" />

<script language="javas cript">
<!--
function __doPostBack(ev entTarget, eventArgument) {
var theform = document.forms["webfrmForm "];
theform.__EVENT TARGET.value = eventTarget.rep lace(/\$/g, ":");
theform.__EVENT ARGUMENT.value = eventArgument;
theform.submit( );
}
// -->
</script>
------------------------------------------------------------

The other asp page generates only this:

------------------------------------------------------------
<form name="wfrmPoked at" method="post" action="pokedat .aspx"
id="wfrmPokedat ">
<input type="hidden" name="__VIEWSTA TE" value="[data]" />
------------------------------------------------------------

The net result is that the first page can have objects onclick perform a
__doPostBack, and the other page throws a javascript error about an expected object; and rightfully so, the __dopostback routine isn't there. But why
isn't it?

What triggers the asp.net creation of the __doPostBack code block? It's
also missing it's __EVENTTARGET and __EVENTARGUMENT hidden values. I can't find any significant differences in either of my pages that would cause
this. I'm using framework 1.1 and 2003 rc2/iis6 server & notepad as an
editor.

Nov 17 '05 #2
Ram
You need to have atleast one web server control that has a
autopostback property to true. Otherwise that code block will not be
generated. Insert a server button on the page and the code block will
be generated.

Thanks
Ram

"E" <e@noreply.co m> wrote in message news:<9O******* *************@s peakeasy.net>.. .
I discovered that the difference between the pages was a combo box on the
first page had the autopostback property of true, whereas the other page did
not have this poperty specified at all. Setting this property to true on
the second page caused asp.net to auto-generate the postback block I was
looking for.

How else can I get asp.net to generate this block? I don't want my combo
box on the second page to autopostback...
"E" <e@noreply.co m> wrote in message
news:1E******** ************@sp eakeasy.net...
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="webfrmFor m" method="post" action="pokedex .aspx"

id="webfrmForm" >
<input type="hidden" name="__EVENTTA RGET" value="" />
<input type="hidden" name="__EVENTAR GUMENT" value="" />
<input type="hidden" name="__VIEWSTA TE" value="[extensive data]" />

<script language="javas cript">
<!--
function __doPostBack(ev entTarget, eventArgument) {
var theform = document.forms["webfrmForm "];
theform.__EVENT TARGET.value = eventTarget.rep lace(/\$/g, ":");
theform.__EVENT ARGUMENT.value = eventArgument;
theform.submit( );
}
// -->
</script>
------------------------------------------------------------

The other asp page generates only this:

------------------------------------------------------------
<form name="wfrmPoked at" method="post" action="pokedat .aspx"
id="wfrmPokedat ">
<input type="hidden" name="__VIEWSTA TE" value="[data]" />
------------------------------------------------------------

The net result is that the first page can have objects onclick perform a
__doPostBack, and the other page throws a javascript error about an

expected
object; and rightfully so, the __dopostback routine isn't there. But why
isn't it?

What triggers the asp.net creation of the __doPostBack code block? It's
also missing it's __EVENTTARGET and __EVENTARGUMENT hidden values. I

can't
find any significant differences in either of my pages that would cause
this. I'm using framework 1.1 and 2003 rc2/iis6 server & notepad as an
editor.

Nov 17 '05 #3
Take a look at Page.GetPostBac kEventReference . It looks like it might have
to generate the script in order to get you a reference to it.
--
John Saunders
Internet Engineer
jo***********@s urfcontrol.com

"E" <e@noreply.co m> wrote in message
news:1E******** ************@sp eakeasy.net...
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="webfrmFor m" method="post" action="pokedex .aspx" id="webfrmForm" > <input type="hidden" name="__EVENTTA RGET" value="" />
<input type="hidden" name="__EVENTAR GUMENT" value="" />
<input type="hidden" name="__VIEWSTA TE" value="[extensive data]" />

<script language="javas cript">
<!--
function __doPostBack(ev entTarget, eventArgument) {
var theform = document.forms["webfrmForm "];
theform.__EVENT TARGET.value = eventTarget.rep lace(/\$/g, ":");
theform.__EVENT ARGUMENT.value = eventArgument;
theform.submit( );
}
// -->
</script>
------------------------------------------------------------

The other asp page generates only this:

------------------------------------------------------------
<form name="wfrmPoked at" method="post" action="pokedat .aspx"
id="wfrmPokedat ">
<input type="hidden" name="__VIEWSTA TE" value="[data]" />
------------------------------------------------------------

The net result is that the first page can have objects onclick perform a
__doPostBack, and the other page throws a javascript error about an expected object; and rightfully so, the __dopostback routine isn't there. But why
isn't it?

What triggers the asp.net creation of the __doPostBack code block? It's
also missing it's __EVENTTARGET and __EVENTARGUMENT hidden values. I can't find any significant differences in either of my pages that would cause
this. I'm using framework 1.1 and 2003 rc2/iis6 server & notepad as an
editor.

Nov 17 '05 #4

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

Similar topics

14
2601
by: Akbar | last post by:
Hey there, Big-time curiosity issue here... Here's the test code (it's not that long)... it's to display a large number of image links with captions, ideally pulled in from an external file (that part's not here -- spotlighting the problem code): --------BEGIN CODE PAGE------------ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...
1
1754
by: Randy | last post by:
Does anyone know of a situation where the "__doPostBack" function would not be auto-generated for your ASPX page? (ie. when the ASPX page is rendered in IE and you do a View Source, the __doPostBack() function was not auto- generated) I have one site that is like this -- looks to be site- wide -- and can't determine why it is doing this?
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...
1
2482
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...
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)....
3
2687
by: Steve Wonderful | last post by:
I checked the rendered html and found __doPostBack() function was not found in the html source. Is there a reason? How do I force it to be generated. The page seems to function properly for post back but I DO need the __doPostBack() function to post back by a child popup window.
1
3075
by: Philip | last post by:
I am attempting to use the ASP.NET generated __doPostBack JavaScript function in my custom JavaScript and I can use it successfully but only after the web page is loaded and idle. I prefer to invoke __doPostBack immediately after web page load. I have been attempting to use the HTML Body OnLoad event to trigger invoking __doPostBack...
0
2918
by: AncaT | last post by:
Hi, I have just started working w/ asp.net, vb.net. I have a .aspx page that contains user defined controls. Inside these controls, I have a 'Delete' hyperlink. This is the code: Inside .ascx file: <a id="deleteitemid" runat="server">delete</a>
0
1658
by: =?Utf-8?B?Uml0YUc=?= | last post by:
Hello. I'm maintaining a C# Web based project that has a class which adds a "Show All" / "Show By Page" functionality to a datagrid that allows paginating. This class works when there are controls on the form that do a postback but does not work when there are none. When there is a postback control I can see the __doPostback function in the...
0
7849
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...
0
8215
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. ...
0
8347
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...
1
7973
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...
0
8220
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...
1
5718
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...
0
3844
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1454
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.