?
Solved

Button CLick with JavaScript and VB code

Posted on 2013-05-10
2
Medium Priority
?
484 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 2000 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

762 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