Webform Question

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

    Webform Question

    Hi,

    In my C#.Net 1.1 Web form project, I have WebFormParent and WebFormChild.
    The WebFormParent has a button btnToChild.
    How will thd code like so when I click the btnToChild, the browser will
    launch WebFormChild?
    Thanks for help.



    Jason


  • Michael Nemtsev

    #2
    Re: Webform Question

    Hello Jason,

    Add OnClick handler to your button where specify window.open JS function.
    See sample below. Put this in OnPageLoad

    btn1.Attributes .Add("onclick", "javascript:Win dow.Open('<your URL>')");


    probablly you could build a url string with query string
    and call like "javascript:Win dow.Open("&strU rl&")"

    JH> Hi,
    JH>
    JH> In my C#.Net 1.1 Web form project, I have WebFormParent and
    JH> WebFormChild.
    JH> The WebFormParent has a button btnToChild.
    JH> How will thd code like so when I click the btnToChild, the browser
    JH> will
    JH> launch WebFormChild?
    JH> Thanks for help.
    JH> Jason
    JH>
    ---
    WBR,
    Michael Nemtsev :: blog: http://spaces.msn.com/laflour

    "At times one remains faithful to a cause only because its opponents do not
    cease to be insipid." (c) Friedrich Nietzsche


    Comment

    • Jason Huang

      #3
      Re: Webform Question

      Thanks Michael.
      But will be the codes put in the "private void btnToChild_Clic k(object
      sender, System.EventArg s e)", so when I Click the btnToChild in the
      WebFormParent, it then will go to WebFormChild?


      "Michael Nemtsev" <nemtsev@msn.co m>
      ???????:9cc1c86 383a828c81baabe b461bc@msnews.m icrosoft.com...[color=blue]
      > Hello Jason,
      >
      > Add OnClick handler to your button where specify window.open JS function.
      > See sample below. Put this in OnPageLoad
      >
      > btn1.Attributes .Add("onclick", "javascript:Win dow.Open('<your URL>')");
      >
      >
      > probablly you could build a url string with query string and call like
      > "javascript:Win dow.Open("&strU rl&")"
      > JH> Hi,
      > JH> JH> In my C#.Net 1.1 Web form project, I have WebFormParent and
      > JH> WebFormChild.
      > JH> The WebFormParent has a button btnToChild.
      > JH> How will thd code like so when I click the btnToChild, the browser
      > JH> will
      > JH> launch WebFormChild?
      > JH> Thanks for help.
      > JH> Jason
      > JH> ---
      > WBR,
      > Michael Nemtsev :: blog: http://spaces.msn.com/laflour
      >
      > "At times one remains faithful to a cause only because its opponents do
      > not cease to be insipid." (c) Friedrich Nietzsche
      >
      >[/color]


      Comment

      • Michael Nemtsev

        #4
        Re: Webform Question

        Hello Jason,

        You can't put this code into the ?# one, because it's client JS. You only
        can call RegisterStartup Script to registrate this

        JH> Thanks Michael.
        JH> But will be the codes put in the "private void
        JH> btnToChild_Clic k(object
        JH> sender, System.EventArg s e)", so when I Click the btnToChild in the
        JH> WebFormParent, it then will go to WebFormChild?
        JH> "Michael Nemtsev" <nemtsev@msn.co m>
        JH> ???????:9cc1c86 383a828c81baabe b461bc@msnews.m icrosoft.com...
        JH>[color=blue][color=green]
        >> Hello Jason,
        >>
        >> Add OnClick handler to your button where specify window.open JS
        >> function. See sample below. Put this in OnPageLoad
        >>
        >> btn1.Attributes .Add("onclick",
        >> "javascript:Win dow.Open('<your URL>')");
        >>
        >> probablly you could build a url string with query string and call
        >> like
        >> "javascript:Win dow.Open("&strU rl&")"
        >> JH> Hi,
        >> JH> JH> In my C#.Net 1.1 Web form project, I have WebFormParent and
        >> JH> WebFormChild.
        >> JH> The WebFormParent has a button btnToChild.
        >> JH> How will thd code like so when I click the btnToChild, the
        >> browser
        >> JH> will
        >> JH> launch WebFormChild?
        >> JH> Thanks for help.
        >> JH> Jason
        >> JH> ---
        >> WBR,
        >> Michael Nemtsev :: blog: http://spaces.msn.com/laflour
        >> "At times one remains faithful to a cause only because its opponents
        >> do not cease to be insipid." (c) Friedrich Nietzsche
        >>[/color][/color]
        ---
        WBR,
        Michael Nemtsev :: blog: http://spaces.msn.com/laflour

        "At times one remains faithful to a cause only because its opponents do not
        cease to be insipid." (c) Friedrich Nietzsche


        Comment

        Working...