ASP.NET 2.0 Gridview Popup

All,
Here is what I want to accomplish. Currently I have a gridview that I am using to populate data from my SQL Server 2000 DB. The client presses edit which puts the grid into edit mode. They make a change to the dropdownlist in the row and then press Update. Prior to updating I want to check the database to make sure that the value they are selecting has not already been assigned in the database. If it has been assigned I want to show a popup stating that the item they have selected in the dropdown has already been assigned and would they like to continue. If they say yes that they would still like to update then I will assign the value in the database and unassign the previous record putting in its place a null value. Here is the code I am currently using to do this. The problem is that I am using a msgbox function that can only be used on my machine becuase I am running, I assume, in a protected enviromnment that lets me have access to the PC I am coding on from IIS. Hopefully this all makes sense.


'New Printer value
Dim sNewPrinter As String = e.NewValues.Item(0)
'Check to see if printer exists already
e.NewValues.Item(2) = Session("SAPID")
Dim SID As String = e.NewValues.Item(2)

Dim sReturn As String = retAnswer(sNewPrinter)
Dim sArray() As String = sReturn.ToString().Split("|")
Dim j As Integer = 0
Dim sAnswer As String = ""
Dim sExistStat As String = ""
sAnswer = sArray(0).ToString()
sExistStat = sArray(1).ToString()

If sAnswer = "YES" Then
If MsgBox("Printer " & sNewPrinter.ToString() & " already exists on " & sExistStat.ToString() & ". Do you still want to update ", MsgBoxStyle.YesNo, "Test Title") = MsgBoxResult.No Then
e.Cancel = True
MsgBox("Item was not updated.", MsgBoxStyle.OkOnly, "Item not updated")
End If
End If

TIA


Answer this question

ASP.NET 2.0 Gridview Popup

  • ASP.NET 2.0 Gridview Popup