Solved

dynamic button how to assign different events

Posted on 2008-10-22
1
225 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
[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
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

Get Actionable Data from Your Monitoring Solution

Your communication platform is only as good as the relevance of the information you send. Ensure your alerts get to the right people every time with actionable responses. Create escalation rules that ensure everyone follows the process and nothing is left to chance.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

691 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