How to call a method in aspx.cs from Class file?

Posted by Oswaldlily under ASP.NET on 4/27/2016 | Points: 10 | Views : 298 | Status : [Member] | Replies : 1
How to call a method in aspx.cs from Class file?

Class.cs
public int progressbar(int Total)
{
// all validation are done here. Based on each validaiton done Im displaying a progress bar message accordingly..
System.Web.UI.Page.UpdateProgress(msg,total); // How to call this file??????

}


aspx.cs

public static void UpdateProgress(string msg, int percent)
{

System.Web.HttpContext.Current.Response.Write(String.Format("<script type=\"text/javascript\">parent.UpdateProgress({0}, '{1}');</script>", percent, msg));

System.Web.HttpContext.Current.Response.Flush();
}




Responses

Posted by: Jayakumars on: 4/27/2016 [Member] [MVP] Bronze | Points: 25

Up
0
Down
hi

easy way put method in your class then call from aspx becos controls value we can get only aspx page so

Mark as Answer if its helpful to you

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response