c# and webforms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Carlos

    c# and webforms

    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(o bject sender, System.EventArg s e)
    {
    if (Calendar2.Sele ctedDate < Calendar1.Selec tedDate)
    {
    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




  • Nicholas Paldino [.NET/C# MVP]

    #2
    Re: c# and webforms

    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]
    - mvp@spam.guard. caspershouse.co m

    "Carlos" <cpalom@yahoo.c om> wrote in message
    news:ebrY5%23Sq DHA.2588@tk2msf tngp13.phx.gbl. ..[color=blue]
    > 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(o bject sender, System.EventArg s e)
    > {
    > if (Calendar2.Sele ctedDate < Calendar1.Selec tedDate)
    > {
    > 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[/color]
    parameters.[color=blue]
    > ?
    >
    > Thanks
    >
    > Carlos
    >
    >
    >
    >[/color]


    Comment

    • Carlos

      #3
      Re: c# and webforms

      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 [.NET/C# MVP]" <mvp@spam.guard .caspershouse.c om> wrote in
      message news:%23dFtSKTq DHA.3616@tk2msf tngp13.phx.gbl. ..[color=blue]
      > Carlos,
      >
      > Instead of calling another ASPX page, you should take the[/color]
      functionality[color=blue]
      > 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[/color]
      like[color=blue]
      > you would any other object.
      >
      > Hope this helps.
      >
      >
      > --
      > - Nicholas Paldino [.NET/C# MVP]
      > - mvp@spam.guard. caspershouse.co m
      >
      > "Carlos" <cpalom@yahoo.c om> wrote in message
      > news:ebrY5%23Sq DHA.2588@tk2msf tngp13.phx.gbl. ..[color=green]
      > > Ok I'm learning C#, I' trying to do a ASP.NET page where a user key a[/color][/color]
      date[color=blue][color=green]
      > > range, now I want it to call a different asp.net c# page that will[/color][/color]
      proces[color=blue][color=green]
      > > that request passing the parameters.
      > >
      > > What I have done so far is the main page were he user type the date[/color][/color]
      range,[color=blue][color=green]
      > > I'll using all webform control, now I have a buton that has the[/color][/color]
      following[color=blue][color=green]
      > > code:
      > >
      > > private void Button1_Click(o bject sender, System.EventArg s e)
      > > {
      > > if (Calendar2.Sele ctedDate < Calendar1.Selec tedDate)
      > > {
      > > 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[/color]
      > parameters.[color=green]
      > > ?
      > >
      > > Thanks
      > >
      > > Carlos
      > >
      > >
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Madhu [MVP]

        #4
        c# and webforms

        Hi,

        To pass values between webforms, have a look at the
        following link...


        url=/library/en-
        us/vbcon/html/vbtskpassingval uesbetweenwebfo rmspages.asp

        Hope this helps..

        Regards,
        Madhu

        MVP | MCSD.NET
        [color=blue]
        >-----Original Message-----
        >Ok I'm learning C#, I' trying to do a ASP.NET page where[/color]
        a user key a date[color=blue]
        >range, now I want it to call a different asp.net c# page[/color]
        that will proces[color=blue]
        >that request passing the parameters.
        >
        >What I have done so far is the main page were he user[/color]
        type the date range,[color=blue]
        >I'll using all webform control, now I have a buton that[/color]
        has the following[color=blue]
        >code:
        >
        >private void Button1_Click(o bject sender,[/color]
        System.EventArg s e)[color=blue]
        > {
        > if (Calendar2.Sele ctedDate <[/color]
        Calendar1.Selec tedDate)[color=blue]
        > {
        > LabelErr.Text = "Please check your dates, the[/color]
        FROM date can be[color=blue]
        >earlier than the TO date";
        > }
        > else
        > {
        > LabelErr.Text = "Processing ... please wait";
        > scaleresult Myscaleresult = new scaleresult[/color]
        ();[color=blue]
        > // WHAT SHOULD I WRITE HERE
        > }
        > }
        >
        >What should I write to call a resilts.aspc page assing[/color]
        the date parameters.[color=blue]
        >?
        >
        >Thanks
        >
        >Carlos
        >
        >
        >
        >
        >.
        >[/color]

        Comment

        Working...