iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I want a user to be able to select a row on my webgrid and then click on a Delete Button to delete the selected row from the database and from the webgrid. (im not that good in asp.net)
If there is no row selected a DialogBox appears with "please selecta a row"
if there is a row selected a DialogBox appears with two buttons to confirm or cancel.
<script runat="server"> Sub DeleteBtn_Click() Handles DeleteBtn.Click 'Delete Button If WebGridEmpf.SelectedRowKeyValue <= "0" Then ErrorMSG.Visible = True 'Dialog box appears with "Please select a row" Else DeleteMSG.Visible = True 'Dialog box appears with: "Do you want to delete this row? yes/no" End If End Sub Sub BtnYes_click() Handles btnYes.Click Dim myConnection As OleDbConnection Dim myCommand As OleDbCommand Dim strSQL As String Dim id As Integer id = WebGridEmpf.SelectedRowKeyValue strSQL = "DELETE * FROM MyTable " _ & "WHERE ID='" & Replace(id, "'", "''") & "';" myConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " _ & "Data Source=C:\inetpub\wwwroot\MyWebsite\DB\Mydatabase.mdb") myConnection.Open() myCommand = New OleDbCommand(strSQL, myConnection) myConnection.Close() DeleteMSG.Visible = False 'Dialogbox disappears End Sub Sub Btnno_click() Handles btnNo.Click Response.Write("sie haben nein gelkickt") DeleteMSG.Visible = False 'Dialogbox disappears End Sub </script>
Hello,
After looking at your code I think it is more easier for you to trigger the event via client side. Do you have any other criterias that keep insist you to use via server side?
Looking forward for your answer.
Thank you and have a nice day.
Best regards,
Niven Prasetya
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname