| Author: Fool To Code 07 Oct 2009 | Member Level: Gold | Rating:  Points: 2 |
you can't do this with javascript. u will have to go in server side code.
<input type="button" id="htmlbutton" runat="server" value="click"/>
onServerClick event of html button write the code for the database
thanks and regards FoolToCode
|
| Author: Anil Kumar Pandey 07 Oct 2009 | Member Level: Diamond | Rating:  Points: 2 |
hi,
Using the java script inserting in the data base in not possible try using the server side coding...
Thanks & Regards Anil Kumar Pandey
|
| Author: Chandru 07 Oct 2009 | Member Level: Silver | Rating:  Points: 2 |
Hi,
We can do with ajax,
just create one function like below,
xmlhttprequestobject.open("POST","yours web page") for ex yours web page = "sample.aspx?a=yours1value,b=2value)
in page load of yours webpage, Just collect the passed values using If (Request.InputStream != null) { string value1 = Request.QueryString["a"] ..brb } just update the received values to database.
Hope this helps,
Thx Chandru NetProgrammingHelp.com
Chandru SilverlightScripting.com
|
| Author: Anuraj 07 Oct 2009 | Member Level: Diamond | Rating:  Points: 2 |
You can't insert data to DB using pure javascript.
Thanks Anuraj THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS. BEWARE OF BUGS IN THE ABOVE CODE; I HAVE ONLY PROVED IT CORRECT, NOT TRIED IT. dotnetthoghts
|
| Author: Sumit Kr Verma 09 Oct 2009 | Member Level: Silver | Rating:  Points: 2 |
hi,
Check attached file.
Thanks
Sumit Kr. Verma
innerhtml.htm |
| Author: Alwyn 13 Oct 2009 | Member Level: Gold | Rating:  Points: 2 |
In the client side, add a hidden control.
<input type="hidden" id="submitType" runat="server"/>
then the html button should be like;
<input type="button" id="Insert" onclick="Insert()"/>
then add a javascript function;
<script language="javascript"> function Insert() { document.formname.submitType = "INSERT"; document.formname.action = "Asp.Net Page Name.aspx"; document.formname.submit() } </script>
in the asp.net pageload()
add the following code
if submitType.value == "INSERT" { write the code for insert here.... }
Thanks & Regards, Alwyn Duraisingh.M
|
| Author: Venkatesh Ellur 26 Oct 2009 | Member Level: Gold | Rating:  Points: 2 |
The simplest way to do this operation would be to use
Ajax Update panel and perform the operation on the Sever side event.
THIS POSTING IS PROVIDED WITH NO WARRANTIES, BEWARE OF BUGS IN THE ABOVE CODE; I HAVE ONLY PROVED IT CORRECT AS PER MY KNOWLEDGE, NOT TRIED IT.
Regards -------------------------- Venkatesh Ellur +919886417764 venkatesh.ellur@gmail.com
|
| Author: Yogesh Jain 29 Oct 2009 | Member Level: Silver | Rating:  Points: 2 |
use ajax for this purpose
goto www.w3schools.com and search for ajax tutorial
Thanks & Regards Yogesh Jain
|
| Author: diyaa 14 Nov 2009 | Member Level: Silver | Rating:  Points: 2 |
it's not possible in asp.net thanx
|