<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EditMyCustom.aspx.cs" Inherits="Portal.Portal.EditMyCustom" %>

<!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></title>
 
<style type="text/css">
 
#apDiv1 {
	position:absolute;
	width:550px;
	height:170px;
	z-index:1;
	left:40px;
	top: 148px;
}

#apDiv1 a{ color:blue}

 input{ width:100px}
</style>
</head>

<body style="font-size:12px; font-family:Verdana, Geneva, sans-serif; color:#336699">
<form runat="server" >

<asp:Label ID="lbl_t" runat="server" Text="" Visible="false"></asp:Label>


<div style=" background-image:url(mycustom.PNG); width:623px; height:375px; ">
  <div id="apDiv1">
  
  
      <asp:GridView ID="GridView1" ShowHeader="false" ShowFooter="false" 
        width="538" height="170" border="1" bordercolor="#abc7e6"  
          style="border-collapse:collapse; text-align:center " runat="server"
          DataKeyNames="id" AutoGenerateColumns="false" 
         DataSourceID="SqlDataSource1" onrowediting="GridView1_RowEditing" 
          onrowupdated="GridView1_RowUpdated" onrowupdating="GridView1_RowUpdating">
          <Columns> 
          
               <asp:BoundField DataField="indexs" ReadOnly="true" ItemStyle-Width="40" />
              <asp:BoundField DataField="name" ItemStyle-Width="165" />
              <asp:BoundField DataField="url" ItemStyle-Width="208" />
        
              <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" ItemStyle-Width="101" />
          </Columns>
      </asp:GridView>
  
      <asp:SqlDataSource ID="SqlDataSource1" 
      
       ConnectionString='<%$ ConnectionStrings:connectionstring %>'

      
      runat="server" DeleteCommand="DELETE FROM [portal_mycustom] WHERE [id] = @id" 
          InsertCommand="INSERT INTO [portal_mycustom] ([myid], [url], [name]) VALUES (@myid, @url, @name)" 
          onselecting="SqlDataSource1_Selecting" ProviderName="System.Data.SqlClient" 
          SelectCommand="SELECT top 6 [myid], [url], [name], ROW_NUMBER() OVER (order by id asc ) as indexs,[id] FROM [portal_mycustom] WHERE ([myid] = @myid)" 
          
          UpdateCommand="UPDATE [portal_mycustom] SET  [url] = @url, [name] = @name WHERE [id] = @id" 
          onupdating="SqlDataSource1_Updating">
          <SelectParameters>
              <asp:Parameter DefaultValue="0" Name="myid" Type="Int32" />
          </SelectParameters>
          <DeleteParameters>
              <asp:Parameter Name="id" Type="Int32" />
          </DeleteParameters>
          <UpdateParameters>
              <asp:Parameter Name="myid" Type="Int32" />
              <asp:Parameter Name="name" Type="String" />
                <asp:Parameter Name="url" Type="String" />
              <asp:Parameter Name="id" Type="Int32" />
          </UpdateParameters>
          <InsertParameters>
              <asp:Parameter Name="myid" Type="Int32" />
              <asp:Parameter Name="url" Type="String" />
              <asp:Parameter Name="name" Type="String" />
          </InsertParameters>
      </asp:SqlDataSource>
  </div>
 

</div>
</form>
</body>
</html>


 