-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: Rambabu Kodali
Message 2 in Discussion
Try this it will work on client side only Public Class ConfirmButton
Inherits System.Web.UI.WebControls.Button 'Some things to note on this button
class
'1) Causes validation property on button must be set to false!
'2) Instead, in the buttons server side click event use the following:
'3) Me.Validate()
'4) If Me.IsValid Then ... (Response.Redirect("Default.aspx"))
'5) This will cause validation prior to button action Private _ButtonMessage
As String Public Property Message() As String
Get
Return _ButtonMessage
End Get
Set(ByVal Value As String)
_ButtonMessage = Value
End Set
End Property Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
Page.RegisterClientScriptBlock( _
"__doAlert", _
"<script language=""javascript"">" & vbCrLf & _
"function __doConfirm(btn){" & vbCrLf & _
"var answer = confirm(""" + _ButtonMessage + """);" & vbCrLf & _
"if (answer){" & vbCrLf & _
"return true;}" & vbCrLf & _
"else{" & vbCrLf & _
"return false;}}" & vbCrLf & _
"</script>" _
) Me.CausesValidation = False
Me.Attributes("onclick") = "return __doConfirm(this);" 'The MyBase
keyword behaves like an object variable referring
'to the base class of the current instance of a class
MyBase.OnPreRender(e) End Sub End Class
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you received
this message by mistake, please click the "Remove" link below. On the pre-addressed
e-mail message that opens, simply click "Send". Your e-mail address will be deleted
from this group's mailing list.
mailto:[EMAIL PROTECTED]