Click here to Skip to main content
15,887,356 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I have a web form created in c#. I have 3 Views on the form i.e.,

vStart
vRecord
vGrid

I have a button named "Edit" in vStart.
Now I want this button to also be visible and functioning in vRecord.

Kindly help me write code for accomplishing it.

Best Regards,
Posted
Updated 21-Jun-13 19:17pm
v2

1 solution

An easy solution would be to create a copy of this button in your view vRecord and let both the buttons share the same handler for the events.
Therefore,
btnEdit.Click += new EventHandler(btnEdit_Click);
btnEdit_on_vRecord_View.Click += new EventHandler(btnEdit_Click);
 
Share this answer
 
Comments
[no name] 22-Jun-13 7:11am    
Thanks for your reply Nitesh. I am sorry I am a only a beginner ... learning c#. Can you please guide me where I need to put the above lines of codes. Do I need to put them in

protected void Page_Load(object sender, EventArgs e)
{
OR

protected void btnEdit_Click(object sender, EventArgs e)
{


OR

protected void btnEdit_on_vRecord_View_Click(object sender, EventArgs e)
{



Bundle of thanks for your help.
Nitesh Kejriwal 22-Jun-13 14:46pm    
You can double click the button from the from to create the event handler and then select the other button to assign the event handler from the properties window. No code will be required from .cs page. Let me know if you have more questions :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900