Solved

How can i determine which dropdownlist caused the postback on Page Load event ?

Posted on 2016-11-17
1
26 Views
Last Modified: 2016-11-17
Hi Experts ,

Is there any method or property that will tell which drop-down list causes the postback property on ASP.NET web form
0
Comment
Question by:karthik80c
1 Comment
 
LVL 14

Accepted Solution

by:
Lokesh B R earned 500 total points
Comment Utility
Hi,

You can get the control which caused postback as below.

 
 
protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                Control c = null;

                string controlName = Page.Request.Params.Get("__EVENTTARGET");

                if (!String.IsNullOrEmpty(ctrlName))
                {
                    c = page.FindControl(ctrlName);
                }

            }
        }

Open in new window

1

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video discusses moving either the default database or any database to a new volume.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now