Tips Station Asp.net Article Seo Articles
Tutorials Code Samples
›  Home
›  Mission
›  About us
›  Contact Us
›  Feedback
›  Terms & Condition
Asp Articles
IT Solutions
 
› ASP.NET

› Programming Tips

› Ajax

› Asp

› ADO.NET

› Databases

› SEO

› CSS And Designing

› Php

 
Most Viewed Articles
 
› Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

› Change theme dynamically without page refresh in ASP.NET

› Install AJAX On Machines Running Visual Studio 2005

› Creating Pretty Popups Using AJAX

› Simple ASP Image Resize Function

› SQL Server Performance Counters

› ASP.Net Interview Questions And Their Answers

› Encode Url using ASP

› Difference Between DataGrid and GridView in Asp.Net

› Select Specific Value WithIn Drop Down List Or Radio Button List

more...
 
 
Home> Programming Tips
 
Find which control caused a postback - Asp.net
 

Pass the page to the function and the control that caused the postback will be returned from the function

    Public Function GetPostBackControl(ByVal page As System.Web.UI.Page) As System.Web.UI.Control  
        ' Find which control caused the postback  
        Dim control As Control = Nothing  
        Dim ctrlname As String = page.Request.Params("__EVENTTARGET")  
        If Not (ctrlname Is Nothing) AndAlso Not (ctrlname = String.Empty) Then  
            control = page.FindControl(ctrlname)  
        Else  
            Dim ctrlStr As String = String.Empty  
            Dim c As Control = Nothing  
           For Each ctl As String In page.Request.Form  
               If ctl.EndsWith(".x") OrElse ctl.EndsWith(".y") Then  
                   ctrlStr = ctl.Substring(0, ctl.Length - 2)  
                   c = page.FindControl(ctrlStr)  
               Else  
                   c = page.FindControl(ctl)  
               End If  
               If TypeOf c Is System.Web.UI.WebControls.Button OrElse TypeOf c Is System.Web.UI.WebControls.ImageButton Then  
                   control = c  
                   ' break  
               End If  
           Next  
       End If  
       Return control  
   End Function 

 
 
Vrp Technologies
 
Serversea Hosting
 
 
Latest Articles
 
› Sending SMS With PHP

› MySQL Join Tutorial

› Make An RSS Feed Using PHP

› Intro To Object: Option Variables

› Design An Online Chat Room With PHP And MySQL

› Create Tell A Friend Script With HTML & PHP

› Benchmark And Optimize PHP Script Speed

› What Kind of DBA Are You?

› SQL Server Performance Counters

› SQL Server Performance Tips

more...
 
Random Articles
 
› Understanding Transaction in ADO.NET

› Creating Pretty Popups Using AJAX

› Search Engine Optimization & Submission Strategies - A Beginners Guide

› Alternating Row Colors

› Clear all Cached objects in Asp.Net

› ASP.NET Simple Connect To Database

› Displaying Data using ASP.NET 2.0 Repeater

› Application Object in Asp

› SQL Server Performance Counters

› ASP.Net Tips and Tricks

more...
 
Home Mission About us Contact us Feedback Terms Conditions
2008 © Copyright TipsStation. All rights reserved.