We help IT Professionals succeed at work.

Understanding c# code

73 Views
Last Modified: 2017-04-07
Hello Experts,
I am working on a web page where data is populated dynamically.  While debugging I came across the following method.  Please explain what it does.  Thank you in advance.

private void ddl_DataBind(Object sender, EventArgs e)
{
       DropDownList ddl = (DropDownList)sender;
       GridViewRow row = (GridViewRow)ddl.NamingContainer;
       ddl.SelectedValue = DataBinder.Eval(row.DataItem, _ColName).ToString();
}
Comment
Watch Question

Nitin SontakkeDeveloper
CERTIFIED EXPERT

Commented:
With the kind of question being asked it seems you are not quite familiar with ASP.NET web application development framework.

I strongly suggest you to (patiently) go through ASP.NET tutorials found on YouTube (search Pragim Technologies, there are thousands) or elsewhere such as Microsoft Virtual Academy.

Understanding code in bits and pieces will not be much helpful and would be huge waste of time and efforts, I believe.

Author

Commented:
Nitin,  Thank you for your advice.  I know where I am .  That's why I posted this question.  I hope to get the answer from somebody else.  Thank you again!
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
I did some research and found the answer.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.