Vikas Singh

Vikas Singh

  • 1.3k
  • 391
  • 13.5k

How to use Delegates in my code ?

Jul 23 2020 7:35 AM
How can i call my Getcountry() mothod using delegates in my code Please help 
 
public delegate void Country();
public delegate void State(int countryid);
public partial class ManualOrder : System.Web.UI.Page
{
      #region[Properties]
      Method objmethod = new Method();
      DataSet ds;
      #endregion
protected void Page_Load(object sender, EventArgs e)
{
      if (!IsPostBack)
      {
      }
}
#region [Bind Data]
public void GetCountry()
{
   DataSet ds = new DataSet();
   ds = Method.CountryForShip(); //this is my static country method which i use in method class  
   ddlcountry.DataSource = ds.Tables[0];
   ddlcountry.DataTextField = "country";
   ddlcountry.DataValueField = "country";
   ddlcountry.DataBind();
   ddlcountry.Items.Insert(0, new ListItem("Select Country", "9999"));
}
 
}

Answers (1)