上载到服务器时,消息框不起作用,但是在本地它起作用 [英] Message Box is not working when upload into server.But locally it work
本文介绍了上载到服务器时,消息框不起作用,但是在本地它起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在这里,我想显示当a=o
比消息框显示消息时,如果删除不起作用的话.但是在本地可以,但是当它上传到服务器时,消息不起作用.
Here I want to show that when a=o
than message box show the message, if not the delete is work. But Locally is all right but when it uploaded into server than message is not working.
Dim qu As String = "select [ReportType_ID] from [Report]"
Dim da As SqlDataAdapter = New SqlDataAdapter(qu, conn)
Dim dt As DataTable = New DataTable()
da.Fill(dt)
Dim start As Integer = 0
Dim Endvalue As Integer = dt.Rows.Count - 1
If (Endvalue >= 0) Then
For value As Integer = start To Endvalue
Dim o As String
Dim a As String
'o = dt.Rows.Item(i).Item("ReportType_ID")
o = dt.Rows.Item(value).Item("ReportType_ID")
a = gvList.DataKeys(e.RowIndex).Value.ToString
If (a = o) Then
MessageBox.Show("Data Exist In Main Report! So, you can't delete from here.")
Response.Redirect("ReportType.aspx")
Exit For
End If
Next value
'DELETE
clsReportType.DeleteReportType(gvList.DataKeys(e.RowIndex).Value)
Dim strJs As String = "<script>alert('Record Deleted Successfully..');</script>"
ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(Page), "alert", strJs, False)
ObjReportType.SelectCountMethod = "GetAllReportType"
e.Cancel = True
Else
End If
End Using
推荐答案
你好罗希特,
我收到了您的消息并将其用于您的要求.
Hello Rohit,
I got your message and use it for your requirement.
protected void Page_Load(object sender, EventArgs e)
{
const string someScript = "alertMe";
if (!ClientScript.IsStartupScriptRegistered(this.GetType(), someScript))
{
ClientScript.RegisterStartupScript(this.GetType(),
someScript, "alert('I was called from Content page!')", true);
}
}
Hello Rohit,
实际上,服务器概念不支持Windows.Form,Windows.Graphics.
为此,您需要将应用程序构建到WPF.
最好的问候
阿努巴瓦·迪姆里
+91 9250168195
Hello Rohit,
Actually Windows.Form,Windows.Graphics is not supported in Server Concept.
For doing this operation you should need to build your application to WPF.
Best Regard
Anubhava Dimri
+91 9250168195
欢迎罗希特,
您可以使用脚本警报来在Web上显示消息.
Welcome Rohit,
You can use script Alerts to use showing Message on the Web.
这篇关于上载到服务器时,消息框不起作用,但是在本地它起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文