msgbox return

nate
03-05-2007, 02:15 PM
OK I am using this below:



Public Function ConfirmFood()
Dim Alert As New Label
Alert.Text = "<script language='vbscript'>" & _
vbNewLine & "Confirm(" & """" & "Do You want some food?" & """" & ")" & _
vbNewLine & "return true; </script>"
Page.Controls.Add(Alert)
End Function


How can I return the value? If I do this:

Public Function ConfirmFood()
Dim Alert As New Label
Alert.Text = "<script language='vbscript'>" & _
vbNewLine & "Confirm(" & """" & "Do You want some food?" & """" & ")" & _
vbNewLine & "return true; </script>"
Page.Controls.Add(Alert)
Return Alert
End Function


It errors out because Alert is a label. Please Help. Thanks

Eduardo Lorenzo
03-05-2007, 03:52 PM
last time I did something of this sort was:

Me.lnkbtn_Delete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this record?');")

this will add the confirm as an attribute to the button. Do what the button does if the user clicked Yes and skip the whole sub if the user clicked No.

I hope this helps.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum