我在 aspx 代码中有以下方法,它后面显示一个 jquery 对话框。如果用户单击对话框上的“提交” ,此方法是否有可能返回true ?
Sub DisplayDialog()
Dim title As String = "title"
Dim content As New StringBuilder()
content.Append(@"<script type=text/javascript>
$(function () {
$('#dialog')
.dialog({
title: 'title',
modal: 'true',
buttons: {
'Submit': function () {
},
'Cancel': function () {
$(this)
.dialog('close');
}
}
});
});
</script>")
ClientScript.RegisterStartupScript(Me.[GetType](), title, content.ToString())
End Sub
编辑:
这是我所拥有的更完整的图片:
Sub GridView1_onRowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs)
Select Case e.CommandName
Case "Upload"
DisplayDialog()
//Get result here from jquery dialog. Do something if result was true
Case "Something"
End Select
End Sub