how can i get user control textbox value when it is called from a method

Posted by Sudani under C# on 6/8/2013 | Points: 10 | Views : 915 | Status : [Member] | Replies : 0
Hi Guys
My first post..
i have created windows form project and user control i used a method in a model control like this
 public Route CreateRouteFromText(UCRouteCreate form)
{

string routecode =form.txtRouteCode.Text;


Route route = new Route();
return route;
}

i called the method from a button in the user control like this
private void btnCreateRoute_Click_1(object sender, EventArgs e)
{
UCRouteCreate form = new UCRouteCreate();

Route route = controller.CreateMovieFromText(form);
controller.InsertRoute(route);



}

i have a class called route
class Route
{

       public string routeCode ;

public string Routecode
{
get
{
return routeCode;
}
set
{
routeCode = value;
}
}
public Route( )
{

}


every time i call the create button event handler the value for the textbox always inserted as empty cani any one direct me to where I'm going wrong please




Responses

(No response found.)

Login to post response