473,287 Members | 3,253 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,287 software developers and data experts.

Onclick Dropped on Render


Hi,

I’ve got a problem with my onclick handlers for command buttons
being dropped on page render for a popup window.

On the opening window, I have several command buttons,
and they all have the standard click handler references
(as they should):
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<input type="submit" name="button03" value="submit text"
onclick="WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions( ...
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

... and this isn’t present for command buttons on the popup page.

On the popup window, the standard click handler is not in the button tags
on the rendered page - and the only buttons that have onclick set
are the ones where I use the Attributes property to set the
button for my own JavaScript handlers:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
string fn_call="javascript:doPostBack_JS('Test','','zxc1' );"
new_button.Attributes.Add ("onclick", fn_call);

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

... and THAT renders OK:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<input type="submit" name="Button04" value="JavaScript Submit"
onclick="javascript:doPostBack_JS('Test','','zxc1' );"
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

I set up a simple test case on the popup window page:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<script language="C#" runat=server>

void SubmitBtn_Click(Object sender, EventArgs e)
{
Message.Text="Hello World!!";
}

</script>

.. . . . . . . . . . . . . . . . . . . . . . . . . . . .

<h3>Button Example</h3>

Click on the submit button.<br><br>

<asp:Button id="Button1"
Text="Submit"
OnClick="SubmitBtn_Click"
runat="server"/>

<p>

<asp:label id="Message" runat="server"/>

</form>

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

... and this is what got sent to the client:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<h3>Button Example</h3>

Click on the submit button.<br><br>

<input type="submit" name="Button1" value="Submit" id="Button1" />

<p>

<span id="Message"></span>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

As should be obvious, onclick isn’t set on the rendered page.

The script source tags are present on BOTH the primary page,
AND the popup page:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
<script src="/Webfolder01/WebResource.axd?d=

<script src="/Webfolder01/WebResource.axd?d=
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This is the JavaScript function that opens the popup window:
// ================================================== =====
function popup01 ()
{
var win_url
= "http://localhost/Webfolder01/CtrlInit12b.aspx";
var win_name
= "_blank";
var win_chrome
= "toolbar=0,scrollbars=1,location=1,statusbar=0,men ubar=0,resizable=1";
var win_dimn
= ",width=444,height=444,left = 290,top = 162";

DBname_popup = window.open (win_url, win_name, win_chrome + win_dimn);
if (window.focus) {DBname_popup.focus()}

stop_postback = true;
}
// ================================================== =====

The really freaky thing about this is that it was working last week,
after I tested it - and it WAS working OK.

Does anyone have any idea as to why this is happening?

THANK YOU FOR YOUR ATTENTION TO THIS!!!

..
May 15 '06 #1
0 1282

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

Similar topics

6
by: Yvan J. Gagnon | last post by:
I am currenly developing a web site using Macromedia fireworks, and am trying to figure out a way (through hand-coding) of attaching a javascript function (onClick="doit=false") to each of the...
2
by: Will | last post by:
(My 4 questins at end after explination) The code below was provided to me to "Popup" a window explaining what a Credit Card Verification Number is and where to find it on a card... it is used as...
10
by: drawde83 | last post by:
Hi, I'm mocking up an interface in javascript for an HCI assignment. I want to be able to make the default onclick event for the buttons on my page to display an alert since the buttons won't work...
3
by: Arulraja | last post by:
Hello, I have created 2 custom server controls, The parent custom control contains multiple child custom controls. The Child control has a button on it. If I Click the button control, it...
2
by: Sedef | last post by:
Hi, i'm trying to create a custom Button user control which will be derived from System.Web.UI.WebControls.Button. the normal server side Button class creates some client side javascript code for...
2
by: Caspy | last post by:
When add a button to a web form, if the button can CauseValidation, the server emits client side javascript as: <input type="submit" name="Button1" value="Button" onclick="if...
8
by: -Karl | last post by:
Snippet: http://www.nomorepasting.com/getpaste.php?pasteid=1020&seen=true&numbered=on&langoverride=asp Line 37 is where I am having the problem. I can't get the onclick event to fire off. Yet...
0
by: bbkm | last post by:
when i am doing dropped table reccovery step1- the tablespace should be in recovery mode is it rite step2 - the database should be in archivelog mode is it rite step-3 - identify the dropped table...
4
by: ismailc | last post by:
Hi, I need help please. I need to create a textbox with a report url in an iframe below. Onclick of button create IFrame and pass textbox value into parameter of iframe src. I'm not to sure...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.