Last post Aug 29, 2020 12:15 PM by uid384379
None
0 Points
3 Posts
Aug 29, 2020 04:21 AM|uid384379|LINK
I have a CountryIdHiddenField and I want to pass the CountryIdHiddenField.Value to the below Function.
public string GetCountriesPdf(Entities.Masters.Country country) { string FilePath = ConfigurationManager.AppSettings["GetCountriesPdf"]; switch(country.Id) { case 1: return FilePath+= "Country file"; } }
I have tried to pass like: protected void btn_Click (object sender, EventArgs e)
{
string Val = CountryIdHiddenField.Value; Country_Bal country = new Country_Bal(); country.GetCountriesPdf(Val); //throwing an error here, that cannot pass this string to Entities.Masters.Country
}
Aug 29, 2020 12:15 PM|uid384379|LINK
I got the answer:
protected void btn_Click (object sender, EventArgs e) { Entities.Masters.Country country = new Entities.Masters.Country(); country.Id = Convert.ToInt32(CountryIdHiddenField.Value); Country_Bal contractBal = new Country_Bal(); contractBal.GetCountries(country); }
None
0 Points
3 Posts
How to Pass a CountryIdHiddenField value to a Function
Aug 29, 2020 04:21 AM|uid384379|LINK
I have a CountryIdHiddenField and I want to pass the CountryIdHiddenField.Value to the below Function.
I have tried to pass like:
protected void btn_Click (object sender, EventArgs e)
{
string Val = CountryIdHiddenField.Value;
Country_Bal country = new Country_Bal();
country.GetCountriesPdf(Val); //throwing an error here, that cannot pass this string to Entities.Masters.Country
}
None
0 Points
3 Posts
Re: How to Pass a CountryIdHiddenField value to a Function
Aug 29, 2020 12:15 PM|uid384379|LINK
I got the answer: