Solved

dynamic button how to assign different events

Posted on 2008-10-22
1
220 Views
Last Modified: 2008-10-22
I need to have one button on an asp.net web form.  The button text will be depend on the "customer status"

So if a customer is "pending" then the button text should be set to "approve customer"

Now I want to pass a variable of "approve" to the click event of this button.

Also if a customer is "approved"  I want button text to say "disapprove" and pass variable to onclick of this button variable "disapprove"

How can I do this?
0
Comment
Question by:mugsey
1 Comment
 
LVL 26

Accepted Solution

by:
Anurag Thakur earned 500 total points
ID: 22776546
when you are loading the data on the form you need to find out the customer status and set the text of the button accordingly
when you are setting the button text also set the command name property of the button which you can use to define what kind of action you need to take to handle the kind of situation
like approval or disapproval
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.commandname(VS.80).aspx
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

743 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

8 Experts available now in Live!

Get 1:1 Help Now