Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
One of my client needs updation on their site whose sourse code is not available.So is there any way to update database using only aspx file.Please Help
Posted

You can use jQuery to save data.
Make a webservice to save the data and then call the webservice from jquery on that aspx file.
 
Share this answer
 
Comments
Namith Krishnan E 16-Jul-14 3:21am    
Could you please provide a link or example
Ranjeet Patel 16-Jul-14 7:56am    
http://forums.asp.net/t/1934215.aspx?Using+jQuery+ajax+to+call+asmx+webservice+methods

in this link some example you can get. try to make your own service.
Namith Krishnan E 1-Aug-14 6:19am    
i want to update an item...not insert.How can i get ID for updating in list view using jquery?
Ranjeet Patel 4-Aug-14 2:43am    
You can use jQuery post method to update the data also. just pass the Id of the list view element you want to update.
Yes, you can. try with SqlDataSource [^]
sample code:
ASP.NET
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head  runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1"  runat="server">

      <asp:SqlDataSource
          id="SqlDataSource1"
          runat="server"
          DataSourceMode="DataSet"
          ConnectionString="<%$ ConnectionStrings:MyNorthwind%>"
          SelectCommand="SELECT EmployeeID,FirstName,LastName,Title FROM Employees"
          UpdateCommand="Update Employees SET FirstName=@FirstName,LastName=@LastName,Title=@Title WHERE EmployeeID=@EmployeeID">
      </asp:SqlDataSource>

      <asp:GridView
          id="GridView1"
          runat="server"
          AutoGenerateColumns="False"
          DataKeyNames="EmployeeID"
          AutoGenerateEditButton="True"
          DataSourceID="SqlDataSource1">
          <columns>
              <asp:BoundField HeaderText="First Name" DataField="FirstName" />
              <asp:BoundField HeaderText="Last Name" DataField="LastName" />
              <asp:BoundField HeaderText="Title" DataField="Title" />
          </columns>

      </asp:GridView>

    </form>
  </body>
</html>
 
Share this answer
 
v2
Comments
Namith Krishnan E 16-Jul-14 3:19am    
I have list view and it is not associated with any sql datasource.listview is binded in Code behind
DamithSL 16-Jul-14 3:25am    
do you need to update the same page or create new page with same functionality? why you don't have source code?
DamithSL 16-Jul-14 3:26am    
do you have full working site? with all pages and dll files?
Namith Krishnan E 16-Jul-14 3:40am    
I want to update the same page.i have full working site with aspx page and dll

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900