-
Nov 21st, 2012, 10:15 AM
#1
Is there a way to ensure that WebForm_FireDefaultButton function is available?
I want to programmatically force asp.net to include the WebForm_FireDefaultButton javascript.
I'm looking something similar to the ClientScript.GetPostBackEventReference method, which ensures the __doPostBack javascript on the form.
Actually I have a custom control that renders as a <div>.
Now I want to add a DefaultButton property to it, just like a normal Panel control has.
When we set the "DefaultButton" property of a Panel control, it automatically includes the javascript for "WebForm_FireDefaultButton", along with a call to that function:
html Code:
<div id="MyDiv" onkeypress="javascript:return WebForm_FireDefaultButton(event, 'MyButton')">
When I do the same thing in my custom control, it errors out with the message saying that WebForm_FireDefaultButton is not defined (which is obvious at present, because I don't know how to tell asp.net engine include it).
So how do I make sure that it includes the javascript for "WebForm_FireDefaultButton" ?
I don't want to hard-code the script in my control. I want it to include whatever way other asp.net controls like (Form, Panel etc.) do it.
Anyone has any ideas about this?
Last edited by Pradeep1210; Nov 26th, 2012 at 01:32 PM.
Reason: described the problem in detail for someone who doesn't want to go thru the entire thread.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|