c# and webforms

  • Thread starter Thread starter Carlos
  • Start date Start date
C

Carlos

Ok I'm learning C#, I' trying to do a ASP.NET page where a user key a date
range, now I want it to call a different asp.net c# page that will proces
that request passing the parameters.

What I have done so far is the main page were he user type the date range,
I'll using all webform control, now I have a buton that has the following
code:

private void Button1_Click(object sender, System.EventArgs e)
{
if (Calendar2.SelectedDate < Calendar1.SelectedDate)
{
LabelErr.Text = "Please check your dates, the FROM date can be
earlier than the TO date";
}
else
{
LabelErr.Text = "Processing ... please wait";
scaleresult Myscaleresult = new scaleresult();
// WHAT SHOULD I WRITE HERE
}
}

What should I write to call a resilts.aspc page assing the date parameters.
?

Thanks

Carlos
 
Carlos,

Instead of calling another ASPX page, you should take the functionality
that is in the page and place it in a class on it's own. Once you have
that, you can create an instance of the object and then call the method like
you would any other object.

Hope this helps.
 
So are you saying that I create a class to handle the code that is in the
result.aspx ?

and if that is the chase how do a erase all control that I have in
Default.aspx to write the result of the queries on the page ?

Carlos


Nicholas Paldino said:
Carlos,

Instead of calling another ASPX page, you should take the functionality
that is in the page and place it in a class on it's own. Once you have
that, you can create an instance of the object and then call the method like
you would any other object.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Carlos said:
Ok I'm learning C#, I' trying to do a ASP.NET page where a user key a date
range, now I want it to call a different asp.net c# page that will proces
that request passing the parameters.

What I have done so far is the main page were he user type the date range,
I'll using all webform control, now I have a buton that has the following
code:

private void Button1_Click(object sender, System.EventArgs e)
{
if (Calendar2.SelectedDate < Calendar1.SelectedDate)
{
LabelErr.Text = "Please check your dates, the FROM date can be
earlier than the TO date";
}
else
{
LabelErr.Text = "Processing ... please wait";
scaleresult Myscaleresult = new scaleresult();
// WHAT SHOULD I WRITE HERE
}
}

What should I write to call a resilts.aspc page assing the date parameters.
?

Thanks

Carlos
 
Back
Top