G
Guest
Hi
i am trying to change my value in my gridview but it does not work?
any ideas?
thanks
Bert
<%@ page language="VB" %>
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Detailsview1.ChangeMode(DetailsViewMode.Edit)
Me.Detailsview1.Rows(2).Cells(1).Text = "new value for lastname"
End Sub
</script>
<html>
<head runat="server">
<title>Details View</title>
</head>
<body>
<form runat="server">
<asp:sqldatasource runat="server" id="MySource"
connectionstring="server=(local);database=northwind;trusted_connection=yes"
selectcommand="SELECT employeeid, firstname, lastname, photo
FROM employees"
updatecommand="UPDATE employees SET firstname=@firstname,
lastname=@lastname WHERE employeeid=@employeeid"
deletecommand="DELETE employees WHERE employeeid=@employeeid" />
<asp:detailsview runat="server" id="Detailsview1"
datasourceid="MySource" AutoGenerateEditButton=true
AutoGenerateInsertButton=true allowpaging="true"
pagersettings-mode="NextPreviousFirstLast" />
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>
i am trying to change my value in my gridview but it does not work?
any ideas?
thanks
Bert
<%@ page language="VB" %>
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.Detailsview1.ChangeMode(DetailsViewMode.Edit)
Me.Detailsview1.Rows(2).Cells(1).Text = "new value for lastname"
End Sub
</script>
<html>
<head runat="server">
<title>Details View</title>
</head>
<body>
<form runat="server">
<asp:sqldatasource runat="server" id="MySource"
connectionstring="server=(local);database=northwind;trusted_connection=yes"
selectcommand="SELECT employeeid, firstname, lastname, photo
FROM employees"
updatecommand="UPDATE employees SET firstname=@firstname,
lastname=@lastname WHERE employeeid=@employeeid"
deletecommand="DELETE employees WHERE employeeid=@employeeid" />
<asp:detailsview runat="server" id="Detailsview1"
datasourceid="MySource" AutoGenerateEditButton=true
AutoGenerateInsertButton=true allowpaging="true"
pagersettings-mode="NextPreviousFirstLast" />
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>