Subscribe to Subscribers
Talk to Webmaster Tony John

Online Members

Ritu
More...

Forums » .NET » Webservices »

Call button click event from webmethod


Posted Date: 09 Jul 2012      Posted By:: chiranjita nayak     Member Level: Silver    Member Rank: 570     Points: 2   Responses: 2



In my page list of record is loading through web method using string builder.

I want add 1 imagebutton in listing and want to call imagebutton click event fire.

How to achieve this??????????????




Responses

#679585    Author: Mahesh Durgam      Member Level: Gold      Member Rank: 140     Date: 09/Jul/2012   Rating: 2 out of 52 out of 5     Points: 3

Hi,

You can use the following code




protected void Page_Load(object sender, EventArgs e)
{
ImageButton objImg = new ImageButton();
objImg.ID = "imgNew";
objImg.Click += new EventHandler(objImg_Click);
Page.Controls.Add(objImg);
}

void objImg_Click(object sender, EventArgs e)
{
Response.Write("btnTest_Click: " + DateTime.Now.ToString());
}



Thanks,
Mahesh



 
#679606    Author: chiranjita nayak      Member Level: Silver      Member Rank: 570     Date: 10/Jul/2012   Rating: 2 out of 52 out of 5     Points: 1

not in pageload i load page through webmethod means using webservice


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : I have one doubt on webservice
Previous : How to consume data from json file through webservice?
Return to Discussion Forum
Post New Message
Category:

Related Messages
Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.