Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 67
  • Last Modified:

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

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
karthik80c
Asked:
karthik80c
1 Solution
 
Lokesh B RDeveloperCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now