How can I bind it to a control/button, then?
I tried Button1.Attributes.Add("onclick", "VBscriptFunctionName();") in
Page_Load, but it is not working either.
Thanks.
"James Zhuo" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "Marina" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > The only way to do that, is if you controls outputs the javascript you
> have
> > there.
> >
> > VBScript and VB.NET code behind - are not related in any way. The
former
> is
> > a client side scripting language, while the latter is a server side
> compiled
> > language. No relation.
>
> Well, VBScript is used for ASP, so it's not necessarily used on the client
> side.
>
> I think you can reuse that code, only that you have to bind it to the
> control/button
> that you want to use.
>
>
> >
> > Your VB.NET would have to generated this VBScript code, for it to run.
> >
> > "Sean" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > Hi,
> > >
> > > I need a pop-up window for user to confirm change. The default button
is
> > the
> > > second option (No). As the user only use IE, I think the VBScript is
an
> > > option. The following code only works for html button. I wonder how I
> can
> > > change it to VB code behind file and use a server control.
> > >
> > > Thanks.
> > >
> > > <script language="VBScript">
> > > Sub cmdDelete()
> > > Dim vbResponse
> > > vbResponse = MsgBox("are you sure you want to delete?", vbYesNo +
> > > vbCritical+ vbDefaultButton2, "Title")
> > >
> > > If vbResponse = vbYes Then
> > > ' do something
> > > Else
> > > ' Label1.Text = "do not do delete"
> > > End If
> > > End Sub
> > > </script>
> > >
> > >
> >
> >
>
>
|