Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Updating to database

Updating to database

Scheduled Pinned Locked Moved ASP.NET
javascripthtmldatabasehelptutorial
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    Uma Kameswari
    wrote on last edited by
    #1

    Hello, I have a big problem.I have a page which has html and asp controls on it.COmplete validation is done using javascript.Now I have 2 dropdownlists one for countries and other for states.I should get the states based on the countries.So I have to set the autopostback of countries dropdownlist to true.The button that I have is submit button of html.the problem is how to write the code to update the data on the page.Right now I have the code in page load event.But as autopostback of countries dropdownlsit is true the page gets posted in between.So I cannot have the update code in the pageload.As the controls are html cotrols how do i write events for html.I cannot write javascript to update the database.It is very very urgent for my project.I need it badly.KIndly some one give me a solution for the problem.

    D M 2 Replies Last reply
    0
    • U Uma Kameswari

      Hello, I have a big problem.I have a page which has html and asp controls on it.COmplete validation is done using javascript.Now I have 2 dropdownlists one for countries and other for states.I should get the states based on the countries.So I have to set the autopostback of countries dropdownlist to true.The button that I have is submit button of html.the problem is how to write the code to update the data on the page.Right now I have the code in page load event.But as autopostback of countries dropdownlsit is true the page gets posted in between.So I cannot have the update code in the pageload.As the controls are html cotrols how do i write events for html.I cannot write javascript to update the database.It is very very urgent for my project.I need it badly.KIndly some one give me a solution for the problem.

      D Offline
      D Offline
      daviiie
      wrote on last edited by
      #2

      I have no idea what your talking about. "the problem is how to write the code to update the data on the page" Cant you put it in the code in the: Private Sub DropDownList_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList.SelectedIndexChanged ?????

      1 Reply Last reply
      0
      • U Uma Kameswari

        Hello, I have a big problem.I have a page which has html and asp controls on it.COmplete validation is done using javascript.Now I have 2 dropdownlists one for countries and other for states.I should get the states based on the countries.So I have to set the autopostback of countries dropdownlist to true.The button that I have is submit button of html.the problem is how to write the code to update the data on the page.Right now I have the code in page load event.But as autopostback of countries dropdownlsit is true the page gets posted in between.So I cannot have the update code in the pageload.As the controls are html cotrols how do i write events for html.I cannot write javascript to update the database.It is very very urgent for my project.I need it badly.KIndly some one give me a solution for the problem.

        M Offline
        M Offline
        Mike Ellison
        wrote on last edited by
        #3

        Change your submit button from an HTML button to an ASP.NET server control <asp:Button runat="server"/>. Create an event handler for its OnClick event and put your update code there. -- modified at 9:02 Thursday 27th April, 2006 By the way, you might want to refrain from adding things like "It is very very urgent for my project.I need it badly." to your forum posts. That's a good way to get your message ignored.

        U 1 Reply Last reply
        0
        • M Mike Ellison

          Change your submit button from an HTML button to an ASP.NET server control <asp:Button runat="server"/>. Create an event handler for its OnClick event and put your update code there. -- modified at 9:02 Thursday 27th April, 2006 By the way, you might want to refrain from adding things like "It is very very urgent for my project.I need it badly." to your forum posts. That's a good way to get your message ignored.

          U Offline
          U Offline
          Uma Kameswari
          wrote on last edited by
          #4

          Hello Mr.Mike, As I have clearly mentioned I cannot change html button to asp button.I have javascript validators.Some Conrols are html controls and some are asp controls.For all the HTML controls i am using javascript to validate.Now I have to continue with that form as it is.I cannot change the button to asp button.How to go abt it.Ok clearly speaking I should send all the values in this page to another page on the button click. Uma

          M 1 Reply Last reply
          0
          • U Uma Kameswari

            Hello Mr.Mike, As I have clearly mentioned I cannot change html button to asp button.I have javascript validators.Some Conrols are html controls and some are asp controls.For all the HTML controls i am using javascript to validate.Now I have to continue with that form as it is.I cannot change the button to asp button.How to go abt it.Ok clearly speaking I should send all the values in this page to another page on the button click. Uma

            M Offline
            M Offline
            Mike Ellison
            wrote on last edited by
            #5

            Uma Kameswari wrote:

            As I have clearly mentioned I cannot change html button to asp button

            I see no mention in your original post that you "cannot change html button to asp button". There was nothing in your original post that "clearly" indicated anything of the sort.

            Uma Kameswari wrote:

            I have javascript validators

            No problem. Lots of ASP.NET pages use custom client side javascript for validation. You can use the OnClientClick property of the <asp:Button /> to run your javascript validation. My original suggestion stands. In my opinion, your best course of action is to code an event handler for the Click event of your submit button (making it an <asp:Button />) and perform your database update in that code.

            U 2 Replies Last reply
            0
            • M Mike Ellison

              Uma Kameswari wrote:

              As I have clearly mentioned I cannot change html button to asp button

              I see no mention in your original post that you "cannot change html button to asp button". There was nothing in your original post that "clearly" indicated anything of the sort.

              Uma Kameswari wrote:

              I have javascript validators

              No problem. Lots of ASP.NET pages use custom client side javascript for validation. You can use the OnClientClick property of the <asp:Button /> to run your javascript validation. My original suggestion stands. In my opinion, your best course of action is to code an event handler for the Click event of your submit button (making it an <asp:Button />) and perform your database update in that code.

              U Offline
              U Offline
              Uma Kameswari
              wrote on last edited by
              #6

              ok Mr.Mike I will check it tomorrow .

              1 Reply Last reply
              0
              • M Mike Ellison

                Uma Kameswari wrote:

                As I have clearly mentioned I cannot change html button to asp button

                I see no mention in your original post that you "cannot change html button to asp button". There was nothing in your original post that "clearly" indicated anything of the sort.

                Uma Kameswari wrote:

                I have javascript validators

                No problem. Lots of ASP.NET pages use custom client side javascript for validation. You can use the OnClientClick property of the <asp:Button /> to run your javascript validation. My original suggestion stands. In my opinion, your best course of action is to code an event handler for the Click event of your submit button (making it an <asp:Button />) and perform your database update in that code.

                U Offline
                U Offline
                Uma Kameswari
                wrote on last edited by
                #7

                Hello Mr.Mike, Can u tell me how to use the onClientClick property of

                M 1 Reply Last reply
                0
                • U Uma Kameswari

                  Hello Mr.Mike, Can u tell me how to use the onClientClick property of

                  M Offline
                  M Offline
                  Mike Ellison
                  wrote on last edited by
                  #8

                  Sure - it's an ASP.NET 2.0 property, and you simply assign the javascript you want rendered as part of the client-side onclick javascript event. The MSDN documentation for OnClientClick[^] has a good example.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups