button and post back

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

    button and post back

    Hi,

    Is there a way that when a button is clicked that it will run code without
    doing a post back?

    I have a button that when it is clicked a message box pops up from the
    javascript event onbeforeunload.

    However, I would like to be able to click the button and run some code
    without the message box poping up

    Any help would be appreciated
    Brian
  • Scott M.

    #2
    Re: button and post back

    Add onClick="javasc ript here" to the button.


    "bbdobuddy" <bbdobuddy@disc ussions.microso ft.com> wrote in message
    news:79E4D8B9-323B-4437-AF2E-38EE42F2CE60@mi crosoft.com...[color=blue]
    > Hi,
    >
    > Is there a way that when a button is clicked that it will run code without
    > doing a post back?
    >
    > I have a button that when it is clicked a message box pops up from the
    > javascript event onbeforeunload.
    >
    > However, I would like to be able to click the button and run some code
    > without the message box poping up
    >
    > Any help would be appreciated
    > Brian[/color]


    Comment

    • bbdobuddy

      #3
      Re: button and post back

      but what happens the code I want to write is Visual Basic.net code

      "Scott M." wrote:
      [color=blue]
      > Add onClick="javasc ript here" to the button.
      >
      >
      > "bbdobuddy" <bbdobuddy@disc ussions.microso ft.com> wrote in message
      > news:79E4D8B9-323B-4437-AF2E-38EE42F2CE60@mi crosoft.com...[color=green]
      > > Hi,
      > >
      > > Is there a way that when a button is clicked that it will run code without
      > > doing a post back?
      > >
      > > I have a button that when it is clicked a message box pops up from the
      > > javascript event onbeforeunload.
      > >
      > > However, I would like to be able to click the button and run some code
      > > without the message box poping up
      > >
      > > Any help would be appreciated
      > > Brian[/color]
      >
      >
      >[/color]

      Comment

      • Scott M.

        #4
        Re: button and post back

        You can't have client side code invoke server-side code without a post back
        or a call to a new server page to process. There's just no way around this.


        "bbdobuddy" <bbdobuddy@disc ussions.microso ft.com> wrote in message
        news:C268FE2B-BFFA-47E5-BA1F-1E20201E0B58@mi crosoft.com...[color=blue]
        > but what happens the code I want to write is Visual Basic.net code
        >
        > "Scott M." wrote:
        >[color=green]
        >> Add onClick="javasc ript here" to the button.
        >>
        >>
        >> "bbdobuddy" <bbdobuddy@disc ussions.microso ft.com> wrote in message
        >> news:79E4D8B9-323B-4437-AF2E-38EE42F2CE60@mi crosoft.com...[color=darkred]
        >> > Hi,
        >> >
        >> > Is there a way that when a button is clicked that it will run code
        >> > without
        >> > doing a post back?
        >> >
        >> > I have a button that when it is clicked a message box pops up from the
        >> > javascript event onbeforeunload.
        >> >
        >> > However, I would like to be able to click the button and run some code
        >> > without the message box poping up
        >> >
        >> > Any help would be appreciated
        >> > Brian[/color]
        >>
        >>
        >>[/color][/color]


        Comment

        • Sreejith Ram

          #5
          RE: button and post back


          In case you are looking for some thing like google suggest
          ((http://www.google.com/webhp?complete=1&hl=en) , to get server side code
          execute without posting back the whole page, it is possible with XMLHTTP

          there was recent MSDN article on this

          Build web apps and services that run on Windows, Linux, and macOS using C#, HTML, CSS, and JavaScript. Get started for free on Windows, Linux, or macOS.


          You may also want to google AJAX (Asynchronous JavaScript and XML)

          sreejith





          "bbdobuddy" wrote:
          [color=blue]
          > Hi,
          >
          > Is there a way that when a button is clicked that it will run code without
          > doing a post back?
          >
          > I have a button that when it is clicked a message box pops up from the
          > javascript event onbeforeunload.
          >
          > However, I would like to be able to click the button and run some code
          > without the message box poping up
          >
          > Any help would be appreciated
          > Brian[/color]

          Comment

          Working...