Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am developing an social application on Asp.net with MS SQL Server 2012 as the database.
I want to display user Their All Updates/Tweets Messages on Webpage and then from this Web page user can Delete or Update any Tweet Messages.

I have user Text boxes to display the most 10 recent Tweet Messages on the Web Page. and also gives a update or delete button with every text field. But I am thinking that by this technique i have to write lot of code of have to map which button is associated with what text field.

I need to know that is there any other better technique to achieve this task.
Posted

 
Share this answer
 
Comments
Muhammad Taqi Hassan Bukhari 3-Apr-14 5:19am    
But what about if i had to show the data of that person who is currently login, not the whole data of the table in the Gridview.
You can simply associate multiple button's click event to a single handler like so:

C#
public partial class MyPage: System.Web.UI.Page
{
    UpdateButton1.OnClick += Update_Click;
    UpdateButton2.OnClick += Update_Click;
    UpdateButton3.OnClick += Update_Click;

    private void Update_Click(Object sender, EventArgs e)
    {
        //Your data update code here.
    }
}
 
Share this answer
 
v2

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