1,105,281 Community Members

Alert Box with ASP.NET and VB.NET

Member Avatar
katieJane
Newbie Poster
13 posts since Mar 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi all

I have, hopefully, a rather small query. I have been creating a system with asp/vb and as I was designing I used msgbox's. Of course when I then uploaded it to the company intranet it didn't like MsgBox. I understand that there are various ways of doing it, such as server side within the asp, however I need it to fit in with the following code:

If (salesOrderStage > 30 And salesOrderStage < 40) Then

            salesOrderStage = salesOrderStage - 30

            Dim updateSQL = "UPDATE TblSalesOrder SET SalesOrderCurrDate = GETDATE(), SalesOrderCurrTime = '" & currentTime & "', SalesOrderActionName = '" & fName & "', SalesOrderStage = " & salesOrderStage & "  WHERE SalesOrderID = " & cmbSopSelect.Text & ";"
            Dim cmdUpdate As New SqlCommand
            cmdUpdate.CommandText = updateSQL
            cmdUpdate.Connection = con
            cmdUpdate.ExecuteNonQuery()

            MsgBox("Order placed in Limbo")
            reloadPage()
        Else
            MsgBox("This order cannot be put into Limbo")
        End If

I would appreciate any ideas or comments :)

Thanks in advance

Member Avatar
vishalrane
Junior Poster in Training
91 posts since Jun 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 13 [?]
Skill Endorsements: 0 [?]
 
0
 
Member Avatar
katieJane
Newbie Poster
13 posts since Mar 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I found this link helped with regards to an alternate method of producing a message box:
http://forums.devshed.com/net-development-87/msgbox-in-vb-net-87777.html

dnanetwork
Practically a Master Poster
633 posts since May 2008
Reputation Points: 18 [?]
Q&As Helped to Solve: 106 [?]
Skill Endorsements: 1 [?]
Banned
 
0
 

Client Side Code

<head runat="server">
    <title>Call JavaScript From CodeBehind</title>
    <script type="text/javascript">
        function Jigsawalert() {
            alert('Jigsaw is coming for you !');
        }
    </script>
</head>

On Button Click (Server Side Code)

Page.ClientScript.RegisterStartupScript(this.GetType(),
            "alert", "Jigsawalert();", true);

I hope you are loking for this.
Try this and let us know your feedback !

Member Avatar
NETProgrammer
Light Poster
49 posts since May 2011
Reputation Points: -3 [?]
Q&As Helped to Solve: 6 [?]
Skill Endorsements: 0 [?]
 
0
 
If (salesOrderStage > 30 And salesOrderStage < 40) Then
     
    salesOrderStage = salesOrderStage - 30
     
    Dim updateSQL = "UPDATE TblSalesOrder SET SalesOrderCurrDate = GETDATE(), SalesOrderCurrTime = '" & currentTime & "', SalesOrderActionName = '" & fName & "', SalesOrderStage = " & salesOrderStage & " WHERE SalesOrderID = " & cmbSopSelect.Text & ";"
    Dim cmdUpdate As New SqlCommand
    cmdUpdate.CommandText = updateSQL
    cmdUpdate.Connection = con
    cmdUpdate.ExecuteNonQuery()
     
    //MsgBox("Order placed in Limbo")
[B]Response.Write("<script language='javascript'> alert('Order placed in Limbo'); </script>")[/B]
    reloadPage()
    Else
    //MsgBox("This order cannot be put into Limbo")
[B]Response.Write("<script language='javascript'> alert('This order cannot be put into Limbo'); </script>")[/B]
    End If

Rep and up appreciated.

Member Avatar
katieJane
Newbie Poster
13 posts since Mar 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Thank you for all the responses! I tried all those suggested but in the end the code I found to work was the following:

If (txtStage.Text < 990 Or (txtStage.Text > 30 And txtStage.Text < 40)) Then
            If (txtStage.Text < 10) Then
                salesOrderStage = salesOrderStage + 30
            ElseIf (txtStage.Text >= 10 And txtStage.Text < 20) Then
                salesOrderStage = salesOrderStage + 20
            End If

            Dim updateSQL = "UPDATE TblSalesOrder SET SalesOrderCurrDate = GETDATE(), SalesOrderCurrTime = '" & currentTime & "', SalesOrderActionName = '" & fName & "', SalesOrderStage = " & salesOrderStage & "  WHERE SalesOrderID = " & cmbSopSelect.Text & ";"
            Dim cmdUpdate As New SqlCommand
            cmdUpdate.CommandText = updateSQL
            cmdUpdate.Connection = con
            cmdUpdate.ExecuteNonQuery()

            ClientScript.RegisterStartupScript(Me.GetType(), "AlertMessageBox", "alert('Order placed in Limbo');", True)
            reloadPage()
        End If

Thanks again everyone!

Question Answered as of 2 Years Ago by vishalrane, dnanetwork and NETProgrammer
You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article