i use a based asp.net cms: umbraco. I don't know i someone know it. Anyway now i have found an ascx control for umbraco to print a table on sql server directly to my site...Yuo can find the control below this page.
Anyway now i need another control to add one row per time on the db directly form umbraco... How can i do?
queengab
0 Points
1 Post
create control to add column on a db
Apr 09, 2009 10:18 AM|LINK
Hi to all,
i use a based asp.net cms: umbraco. I don't know i someone know it. Anyway now i have found an ascx control for umbraco to print a table on sql server directly to my site...Yuo can find the control below this page.
Anyway now i need another control to add one row per time on the db directly form umbraco... How can i do?
I'm not a developer...i'm only a little geek...
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UmbracoCollapsableGridView.ascx.cs" Inherits="BP.Umb.JensineControls.UmbracoCollapsableGridViewControl" %>
<%@ Register Namespace="BP.Umb.WebControls" TagPrefix="bpwc" Assembly="BP.Umb.WebControls" %>
<script src="/usercontrols/GridControls/Scripts/CollapsableGridViewJScript.js" type="text/javascript"></script>
<link href="/css/BP.Umb.UserControls.css" rel="stylesheet" type="text/css" />
<asp:SqlDataSource ID="SqlDataSourceUCGV" runat="server"
SelectCommand="SELECT * from foo">
</asp:SqlDataSource>
<bpwc:GridView ID="GridViewUCGV" runat="server" DataSourceID="SqlDataSourceUCGV"
OnRowDataBound="gv_RowDataBound" AllowPaging="False" PageSize="20"
AllowSorting="True" EnableViewState="False" oninit="Page_Init" CssClass="UCGV_Table">
<HeaderStyle CssClass="UCGV_Header" />
<RowStyle CssClass="UCGV_Row" />
<AlternatingRowStyle CssClass="UCGV_RowAlt" />
<Columns>
<asp:TemplateField ItemStyle-CssClass="UCGV_ColumnHidden" HeaderStyle-CssClass="UCGV_HeaderHidden">
<ItemTemplate >
</td>
<td colspan="100%">
<div id="div<%# Container.DataItemIndex+1 %>" class="UCGV_Detail" style="display: none; position: relative;">
<a href="javascript:switchViews('div<%# Container.DataItemIndex+1 %>', 'one');">
<img id="img2div<%# Container.DataItemIndex+1 %>" alt="Click to show/hide details" border="0"
src="/usercontrols/GridControls/Images/expand_button_white.jpg" />
</a>
<div style="position: relative; left: 25px;">
<asp:Label ID="DetailsLabel" runat="server" Width="100%"></asp:Label>
</div>
</div>
</td>
</tr>
<tr >
<td class="UCGV_ColumnHidden" >
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderStyle-CssClass="UCGV_HeaderExpand">
<ItemTemplate>
<a href="javascript:switchViews('div<%# Container.DataItemIndex+1 %>', 'one');">
<img id="imgdiv<%# Container.DataItemIndex+1 %>" alt="Click to show/hide details" border="0"
src="/usercontrols/GridControls/Images/expand_button_white.jpg" />
</a>
</ItemTemplate>
<AlternatingItemTemplate>
<a href="javascript:switchViews('div<%# Container.DataItemIndex+1 %>', 'alt');">
<img id="imgdiv<%# Container.DataItemIndex+1 %>" alt="Click to show/hide details" border="0"
src="/usercontrols/GridControls/Images/expand_button_white_alt.jpg" />
</a>
</AlternatingItemTemplate>
</asp:TemplateField>
<asp:TemplateField headertext="Row Number" Visible="false">
<ItemTemplate>
<%# Container.DataItemIndex+1 %>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</bpwc:GridView>
Template to call
<%@ Master Language="C#" MasterPageFile="/masterpages/MasterTemplate.master" AutoEventWireup="true" %>
<asp:Content ContentPlaceHolderID="MasterTemplateContentPlaceHolder" runat="server">
<form id="MainMasterForm" runat="server">
<umbraco:Macro Alias="GridViewCollapsable"
runat="server"
PageSize="25"
EnableSorting="1"
EnableExpansion="1"
SelectCommand="select data,tipo,oggetto,num,descr,allegato FROM dbo.tabellaok2 WHERE tipo='prova' "
ConnectString="Data Source=xxxxxxxxxxx;Initial Catalog=xxxxxxx;Persist Security Info=True;User ID=xxxxxxxxxxx;Password=xxxxxxxxxxx">
</umbraco:Macro>
</form>
</asp:Content>