显示模式对话框或表单时出错 [英] Error while showing a modal dialog box or form
问题描述
我正在检查数据库中是否存在emailId,如果存在我正在寻找创建确定/取消"确认对话框.如果用户说确定",我将重定向到其他形式.
I am checking emailId exists in DB, If Exists I am looking to create a Ok/Cancel confirmation dialog. if user say "Ok" I am redirecting to some other form.
我的代码是:
If emailId = True Then
If MsgBox("Your email address exists in our database. Click OK to update your Details.", MsgBoxStyle.Information + MsgBoxStyle.OkCancel, Title:="NJ Golf Resort") = MsgBoxResult.Ok Then
Response.Redirect("~/articles.asp?a=" & a & "&b=" & b )
End If
End If
对于上面的代码,我遇到了错误:
for above code i m getting error :
显示模式对话框或表单当应用程序未在其中运行时UserInteractive模式无效手术.指定服务通知或DefaultDesktopOnly样式来显示来自服务的通知应用
Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application
推荐答案
function redirect(a,b){
if(confirm('Your email id is in DB')){
window.location.href='/articles.asp?a='+a+'&b='+b;
}
}
在服务器端,调用上述客户端功能为
In serverside call the above client side function as
If emailId = True Then
this.Page.ClientScript.RegisterStartupScript(this.GetType(), "EmailID", String.Format("redirect({0},{1});", aValue, bValue), true);
/*For Asp.net AJAX use the following code*/
ScriptManager.RegisterStartupScript(this.GetType(), "EmailID", String.Format("redirect({0},{1});", aValue, bValue), true);
如果结束
注意:我已经给出了C#代码.请转换为VB.
Note:I have given the C# code.Translate to VB.
这篇关于显示模式对话框或表单时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!