Solved

Button CLick with JavaScript and VB code

Posted on 2013-05-10
2
460 Views
Last Modified: 2013-05-13
I have a button that on click I want to (modify an )use this Javascript with a yes no confirm that (len) records are being deleted
function getit() {
    var grid = $find("<%= rgQueue.ClientID %>");
    var len = grid.get_masterTableView().get_dataItems().length;
    alert(len);
}

Open in new window


If confirm = OK

Then let the VB code run
    Private Sub rbCancelList_Click(sender As Object, e As System.EventArgs) Handles rbCancelList.Click
        Dim a As ArrayList = GetTelerikGridSelections(rgQueue)
        'do something with the ArrayList
    End Sub

Open in new window

0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 28

Accepted Solution

by:
Ark earned 500 total points
ID: 39160303
'server
rbCancelList.OnClientClick = "getit()"
Private Sub rbCancelList_Click(sender As Object, e As System.EventArgs) Handles rbCancelList.Click
        Dim a As ArrayList = GetTelerikGridSelections(rgQueue)
        'do something with the ArrayList
    End Sub

'client
function getit() {
    var grid = $find("<%= rgQueue.ClientID %>");
    var len = grid.get_masterTableView().get_dataItems().length;
    return confirm( 'delete ' + len + ' records?');
}
0
 

Author Closing Comment

by:lrbrister
ID: 39161099
Thanks
0

Featured Post

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question