Solved

C# - Datagrid - Javascript

Posted on 2013-02-06
6
390 Views
Last Modified: 2013-02-12
I am developing a website that uses a datagrid.  I am familiar with how to loop through the contents of a grid.  The grid structure is similar to below

ID      Product                Price     Qty
1        Brakes Pads        $2.00        1
2        Rotors                $20.00       1
3        Spark Plugs         $4.00       0

What I need is a solution that will accomplish this.  When looping through the grid I will be looking at the QTY columns (which is a textbox).  I know how to do this part!

Here is where I need help:
If I find a quantity of 0 I need to have a pop-up message box display that states:  Do you want any items with 0 Qty to be put in a separate work order?  
If the user says yes then I will create a new work order where Qty = 0.  If no I will delete those items.  
I just need to know: (1) how to get a pop-up box in ASP.NET to display to the user (2) how to call the correct method after the user clicks on either yes or no.  

Please provide code sample.  Thanks
0
Comment
Question by:CipherIS
  • 4
6 Comments
 
LVL 20

Expert Comment

by:informaniac
ID: 38861048
Are you doing the looping part in javascript? Also, will there be a submit button in the page, on click of which you will loop through? What happens if there are multiple rows with 0 qty in the textbox.
0
 
LVL 1

Author Comment

by:CipherIS
ID: 38861133
No.  Looping will be done in C#.  

If there are multiple rows I will be creating a list with the ID's for those items and pass the list to a method which will process accordingly.
0
 
LVL 12

Assisted Solution

by:jitendra patil
jitendra patil earned 150 total points
ID: 38863433
While you are looping around check for the textbox value if you find the value to 0 then call a javascript function from code behind. check the link below for same
Multiple Ways to Call Javascript Function from CodeBehind in ASP.Net

write the appropriate javascript code for confimation and check for the result, if its "Yes" write code for adding new data & if the result is "NO" then write code for deleting the record.

hope this helps.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 1

Author Comment

by:CipherIS
ID: 38864803
Ok, that helps but I need the buttons to say Yes / No not Ok / Cancel.
0
 
LVL 1

Accepted Solution

by:
CipherIS earned 0 total points
ID: 38865298
0
 
LVL 1

Author Closing Comment

by:CipherIS
ID: 38879496
has solution i was looking for
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Keyboard 2 32
Cant save 3D 4 19
how can i apply an assert arrayEqual function ? 2 23
Need help with a Crystal Report in my C#.Net application 2 11
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

816 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now