Tim Hansen

Tim Hansen

  • NA
  • 3
  • 2.5k

Use function to load data for multiple forms

Apr 14 2011 4:18 PM
I'm working on an app that has a function that loads form information to be displayed. but it loads it , directly? 

<PreviewFormCtrl:REVIEWFORM id="ReviewForm" runat="server"></PreviewFormCtrl:REVIEWFORM>
(in code behind)
private void LoadFormPreview()
{
this.ReviewForm.lblCo_Name = this.txtCo_Name.Text.ToString();
this.ReviewForm.lblCo_Address1 = this.txtCo_Address1.Text.ToString();
...

can i make this more generic so i can provide the form as a parameter?  if so, what would the datatype be? i attempted using a string but that just produced an error..

private void LoadFormPreview(string rvwForm)
{
this.rvwForm.lblCo_Name = ...


Any help would be very much appreciated.
Thanks


Answers (2)