473,386 Members | 1,668 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.

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 1287

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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.