Display Confirmation Message Before Deleting A Record From Database
Dec 12, 2012
I have a web in asp.net+vb code and sql database
Protected Sub movebtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles movebtn.Click
Dim con As New SqlConnection
con.ConnectionString = ConfigurationManager.ConnectionStrings("26ConnectionString").ConnectionString
If persno.Text = "" Then
Page.ClientScript.RegisterStartupScript(Me.GetType, "Forms", "<script> alert('Enter Pers No of Offr ..........') </script>")
I want to add a confirmation before deleting the data and popup message box...
but i still encounter these errors:
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
i m doing when i enter travel id in textbox1 and click on button1 then in textbox2 i retrieve the travel agency name according to the travel id i entered in textbox1, I want when no record is found according to the travel id i entered in textbox1 then in textbox2 it shows the message no record found ...this is coding i use to retrieve record in textbox2 by enter travel id in textbox1 : have a look ...
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click Dim SQLData As New System.Data.SqlClient.SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=|DataDirectory|ASPNETDB.MDF;Integrated Security=True;User Instance=True") Dim cmdSelect As New System.Data.SqlClient.SqlCommand("SELECT * FROM a1_vendors WHERE VendorId ='" & TextBox1.Text & "'", SQLData) SQLData.Open() Dim dtrReader As System.Data.SqlClient.SqlDataReader = cmdSelect.ExecuteReader() [code]...
I am using Local reports(RDLC) for my reports in Asp.net
I have the following code in my button.I am able to send my pdf report as mail,and every thing is ok,But Problem is I am unable to produce a Confirmation message,like "Mail sent successfully".How could i change my code.
On a check box check changed I want to test some conditions and based on that I want to display a confirmation message. Based on the user action, OK or Cancel I want to proceed or stop the process. How can I do that. I tried this,
Even I click Cancel the rest of the code also executed. How can I handle this?
I am using gridview,in that gridview i provide a link button as delete,if the user click the delete button,it will deleted properly no problem in my code,before delete i want to show an dialog box like, are you want to delete the employee details,,how can i do this in my code..
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As GridViewCommandEventArgs) Handles GridView1.RowCommand If (e.CommandName = "DELETE_Employeeid") Then 'Delete button is clicked Dim empid = e.CommandArgument.ToString()
I've been googling for 2 days for the solution, but I couldn't find something useful. The problem is that I have GridView that is connected to the SQL database and that is how it is being populated. I added EDIT and DELETE buttons in the columns, but as far as I can see the event which handles them is empty.
I've followed a blog here on removing a record. this is what I have. everything works except the page doesn't refresh after delete has been called as if it's doing it in AJAX. I only see the change when i do a manual page refresh. [URL]
I put the code above to display a confirmation message box.. but the problem is whatever button i clicked, it still continue.. all i want to happen is when i clicked the cancel button, it will not proceed..
I have one page which contains 3 panels and 3 buttons. Each panel connects one button. When one button clicks, the relative panel appears and other panels are divisible. For each panel, I design a textbox, a merge button and a gridview. When user input information into the textbox, the gridview shows the detail data from the database and two checkboxes. The next step, user uses checkboxes to choose two different rows of data and click the merge button. I need to show a confirmation message based on the selection user made i.e. Are you you want to merge A to B.
write the code to show the confirmation message which is works perfectly in Page_Load() method. But the problem is the page contains 3 panels. Do I need to write code for each panel to show the confirmation message and put 3 sets of the code in Page_Load?