Results 1 to 3 of 3
-
12-09-2008, 04:06 PM #1
- Join Date
- Apr 2008
- Location
- Boston, USA
- Posts
- 13,172
- Thanks
- 744
- Thanked 699 Times in 550 Posts
- Blog Entries
- 4
- Feedback Score
- 4 (100%)
Find the control that raised postback event on a page
Using this method you may find the control that raised the PostBack event on a page.
Code in C#:
public static Control GetPostBackControl(Page page)
{
Control control = null;
string ctrlname = page.Request.Params.Get("__EVENTTARGET");
if (ctrlname != null && ctrlname != string.Empty)
{
control = page.FindControl(ctrlname);
}
else
{
foreach (string ctl in page.Request.Form)
{
if ((ctl.LastIndexOf(".x") > 0) || (ctl.LastIndexOf(".y") > 0))
{
control = page.FindControl(ctl.Substring(0, ctl.Length - 2));
break;
}
/*control = page.FindControl(ctl);
if ((control is System.Web.UI.WebControls.Button))
{
break;
}*/
}
}
return control;
}Free Classified Ads & BUSINESS/PROFESSIONAL SOCIAL NETWORK
-
12-09-2008, 06:33 PM #2
Manik, sorry for being n00bish but what is PostBack?
Amir Mullick, SEO and Internet Marketer.
Wanna learn more about SEO? Visit my SEO Blog and Gadgets Blog
-
12-09-2008, 06:47 PM #3
- Join Date
- Apr 2008
- Location
- Boston, USA
- Posts
- 13,172
- Thanks
- 744
- Thanked 699 Times in 550 Posts
- Blog Entries
- 4
- Feedback Score
- 4 (100%)
-
The Following User Says Thank You to manik For This Useful Post:
Amirmullick3 (12-10-2008)
Similar Threads
-
Great Article:How to get indexed faster
By krates98 in forum DirectoriesReplies: 29Last Post: 04-30-2012, 09:25 AM -
Free Search Engine Submission Links
By Nazia in forum All Other Search EnginesReplies: 28Last Post: 01-31-2012, 02:50 AM -
All You Need To Know About SEO
By articleenterprise in forum Search Engine OptimizationReplies: 19Last Post: 04-13-2009, 02:14 AM -
Page Load Sequence with Masterpage
By manik in forum ASPReplies: 2Last Post: 01-16-2009, 01:24 PM -
Detect if a control raised PostBack event
By manik in forum ASPReplies: 1Last Post: 12-17-2008, 07:04 AM


Reply With Quote




