Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

C# - Datagrid - Javascript

Posted on 2013-02-06
6
Medium Priority
?
409 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
[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
  • 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 13

Assisted Solution

by:Jitendra Patil
Jitendra Patil earned 600 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
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
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…

721 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