Updating to database
-
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.
-
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.
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 ?????
-
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.
Change your submit button from an HTML button to an ASP.NET server control
<asp:Button runat="server"/>
. Create an event handler for itsOnClick
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. -
Change your submit button from an HTML button to an ASP.NET server control
<asp:Button runat="server"/>
. Create an event handler for itsOnClick
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.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
-
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
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 theClick
event of your submit button (making it an<asp:Button />
) and perform your database update in that code. -
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 theClick
event of your submit button (making it an<asp:Button />
) and perform your database update in that code.ok Mr.Mike I will check it tomorrow .
-
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 theClick
event of your submit button (making it an<asp:Button />
) and perform your database update in that code.Hello Mr.Mike, Can u tell me how to use the onClientClick property of
-
Hello Mr.Mike, Can u tell me how to use the onClientClick property of
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.