2
Answers

Use function to load data for multiple forms

Tim Hansen

Tim Hansen

13y
2.2k
1
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)
Next Recommended Forum