function confirmation() {
var answer = confirm("Are you sure you want to delete? This action cannot be undone.")
}
So right now, clicking the delete button executes the btnDelete_Click Sub in the code behind regardless of whether you click okay or cancel in the pop up box. I know I can add if (answer) { -- some code here -- } in my javascript function, but is it possible to use javascript to execute code from the codebehind? Or is there another way to do this?
I am working with a .Net 1.1 web application. There is a Save button that, when clicked, will pop up the Javascript confirm box. Once the user clicks OK a long running process is kicked off. We would like to show a busy indicator when the user clicks the OK button of the confirm dialog.
I want it so that when a user clicks on a radio button, it gives them an OK/Cancel javascript dialog box - if they click OK the code for the radio button will run, if they click Cancel, nothing happens.For a button I can easily do this by changing the OnClientClick property, but with a radio button I can't get anything to work properly.
I try this:
rbNo.Attributes.Add( "onclick", "return confirm('This Are you sure');")
How to return value from javascript confirm box written in scriptmanager.registerclientscript in asp.net.?Actually I want to give confirm box on text changed event of textbox of gridview.If user click yes then I want to update changed value and if user click no then it should revert back to old value.My dummy code is like this:
I've got a huge problem here. I've managed to add javascript to my server side, but the problem it is not deleting. It doesnt have produce any errors so I don't know where to start:
I am working on a VB.NET web application. When someone successfully changes their password I want to show a popup message that lets them know it was changed successfully. After they click OK I want to redirect them to the main page. Code looks like this:
I am have been trying to teach myself ASP.NET and Javascript for a project and have been stuck on one problem for literally dozens of hours now. I found a really nice javascript drag-and-drop list online, copied the source offered and split the css into a .css file, the javascript into a .js file and the HTML and reference into my asp.net page. It worked perfectly. Next, I replaced the javascript list with a static HTML list populated with the same data, wrapped it in an UpdatePanel and set up an "edit order" button to swap the static list's HTML for the javascript list's HTML when the button is pressed.
I have several <asp:TextBox TextMode="MultiLine"> elements on a page. On load, I populate them (through the VB code behind), and then turn them into TinyMCE editors (through the Query TinyMCE plugin). Each text box also has a button associated with it, with the purpose of submitting the text back to the code behind for insertion into a database.I discovered earlier that when the submit button is clicked, I have to "save" the contents of the editor to the text box, but that is not my problem. Even after I've done so, the edits are not showing up in the code behind.As I've mentioned, I'm using jQuery. Here is my click handler. Keep in mind that all buttons are submit buttons in ASP.NET, hence the submit class:
I'm trying to eliminate a VB.NET button on my aspx page. Trying to use javascript and ajax to execute the same code my vb had.I put in a script manager, set EnablePageMethods to true, added a static subroutine, and referred to it in my javascript function (BTW -- this seems a lot of work just to execute an existing subroutine). The javascript calls my code-behind and it almost works.Problem is, now I'm getting a NullReferenceException when SimulatePrintBatchClick tries to do anything with the controls.
Error is 'Object reference not set to an instance of an object', line is 'pnlVars.Controls.Clear'
Here's the code from UW.aspx:
<WebMethod()> _ Public Shared Sub PrintBatchFromJSWM() Dim UWI As New UW
[code]....
when I run the above code in PrintBatch_Click it all executes just fine. I really don't understand why it bombs out as a subroutine.
Perhaps this is not the way to do this, but I'm at a loss for finding a different way. Originally this code was handled by an ASP/VB button, but the specs have called for it to be deleted.
After a user takes some action, it is sometime necessary to confirm that the user is sure that the action should be takes. Classic example is if the user attempts to close a form which is 'dirty' or not saved.What is the preferred way to do this in .net?
I need to add a confirm delete action to a grid. the problem is the way the "Delete" link is rendered. my grid is built in code behind in vb.net.i have this
The code i have so far inputs the users username and pas that they inputted into 2 textboxes. Next the user hits login and it submits the info. Here is where i have a problem. Some users are already logged in when they get to the site, this is a problem because i need to make sure they are logging in correctly. Here comes another problem, lets say they log in correctly, how can i know that the login was successful?
Simplified:
1) How can i find out if the user is already logged in so i can log them out.
2) If they are not logged in, and they log in successfully. how can i confirm that?
If there is any other way to login without web browsers?
'Code to enter the user and pass into the webpage WebBrowser1.document.GetElementById("Username").InnerText = TextBox1.Text WebBrowser1.document.GetElementById("Password").InnerText = TextBox2.Text 'Code to click login on the webpage WebBrowser1.document.GetElementById("submit").InvokeMember("click")
I have this in my form closing event: For Each FileFound As String In Directory.GetFiles(App_Path() & "tmp", "*.txt") File.Delete(FileFound) Application.DoEvents() Next For Each FileFound As String In Directory.GetFiles(App_Path() & "tmp", "*.txt") File.Delete(FileFound) Next
I used to run through an ultragrid with a for each loop and that took forever, I stumbled accross this way and it's much faster but I noticed today I still have some straggling .txt files after the form closes at times. Is there a way to actually verify all the files have been deleted before closing the form?
I ran the same for each loop twice to work it out but not sure if that works or worsens it. Also, I'm not entirely sure what that application.doevents does as I initially thought it would finish all above lines before continuing but that does not seem the case. Anyway, these .txt files files are about 500KB and up to 1000 of them at any one time so it's not instant but it's still pretty fast, faster then looping through a grid.
Well, I have a form called customers. Login form and mainform.
So my clients want to have an option that explains this: If a user enters information in the customer form, then that information has to be confirmed by admins panel.
Get me well. When application program loads with a limited user, I set some buttons hidden so that only admin can see it when they log in. so in that case, users are not capable of inserting anything in the customer form.
But this time they want users to insert information then the information goes to administrators to confirm the information...if admins accepts the information, then information is then goes to customers table in database. If they don't confirm it, then that information will be ignored.
If I have a form in my application that has a datasetview and allows users to edit entries, how best can I present the information back to them to show them the changes that they've made, and ask them to confirm changes?
I am trying to get a confirmation box to display when the exit button is clicked. The problem is, my form is closing even when you click the "NO" button.
Here is the code: Private Sub exitMenu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitMenu.Click MessageBox.Show( "Are you sure you want to exit?", "CONFIRM", MessageBoxButtons.YesNo, MessageBoxIcon.Question) If (Windows.Forms.DialogResult.Yes) Then Me.Close() ElseIf (Windows.Forms.DialogResult.No) Then Exit Sub End If End Sub
I want to write a program that if ping www.microsoft.com is success,than caption title it's "ok,connected Internet",if ping it's failed,the program "caption" title is "sorry,not connected",but I don't know how to write those code
Just a pretty question that seem to me a bit difficult to do it. Well, I have a form called customers. Login form and mainform. So my clients want to have an option that explains this: If a user enters information in the customer form, then that information has to be confirmed by admins panel.
We currently have a asp.net website with some modules developed in VB.Net & some in C# (not just classes but also individual aspx pages and code behind). We figur
I have the following code in my codebehind Page_Load function that sets the default selected value of a dropdownlist in detailsview based on the name of a record returned from a sql data query.Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load