PopUpExtender and Comma
Tue, 15 Dec 2009 02:34:59 GMT
Posted by mfalac
Tags:
<asp:TextBox ID="MyTextBox" runat="server" Width="538px"></asp:TextBox>
<br />
<br />
<asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" >
<ContentTemplate>
<asp:RadioButtonList ID="RadioButtonList1" runat="server" OnSelectedIndexChanged="RadioButtonList1_SelectedIndexChanged" AutoPostBack="true" Width="146px">
<asp:ListItem Text="ozkan"></asp:ListItem>
<asp:ListItem Text="deniz"></asp:ListItem>
<asp:ListItem Text="cherline"></asp:ListItem>
<asp:ListItem Text="fatih"></asp:ListItem>
<asp:ListItem Text="veronica"></asp:ListItem>
</asp:RadioButtonList>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<br />
<cc1:popupcontrolextender
ID="PopupControlExtender1" runat="server"
TargetControlID="MyTextBox" PopupControlID="Panel1"
CommitProperty="value" CommitScript="e.value ;"
Position="Bottom">
</cc1:popupcontrolextender>
code:
Protected Sub RadioButtonList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadioButtonList1.SelectedIndexChanged
If MyTextBox.Text = "" Then
If Not (String.IsNullOrEmpty(RadioButtonList1.SelectedValue)) Then
Dim r As String = RadioButtonList1.SelectedValue
Dim s As String = MyTextBox.Text
PopupControlExtender.GetProxyForCurrentPopup(Me.Page).Commit(r + s)
End If
Else
If Not (String.IsNullOrEmpty(RadioButtonList1.SelectedValue)) Then
Dim r As String = RadioButtonList1.SelectedValue
Dim s As String = MyTextBox.Text
PopupControlExtender.GetProxyForCurrentPopup(Me.Page).Commit(r + "," + s)
End If
End If
'RadioButtonList1.ClearSelection()
End Sub
Popup Control With an UpdatePanel (Calendar control)
Wed, 18 Nov 2009 02:36:44 GMT
Posted by mfalac
<div>
Departure date: <asp:TextBox ID="tbDeparture" runat="server" />
Return date: <asp:TextBox ID="tbReturn" runat="server" />
</div>
<asp:Panel ID="pnlCalendar" runat="server">
<asp:UpdatePanel ID="up1" runat="server">
<ContentTemplate>
<asp:Calendar ID="c1" runat="server" OnSelectionChanged="c1_SelectionChanged" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<cc1:PopupControlExtender ID="pce1" runat="server"
TargetControlID="tbDeparture" PopupControlID="pnlCalendar" Position="Bottom" >
</cc1:PopupControlExtender>
<cc1:PopupControlExtender ID="pce2" runat="server"
TargetControlID="tbReturn" PopupControlID="pnlCalendar" Position="Bottom" >
</cc1:PopupControlExtender>
vb is :
Protected Sub c1_SelectionChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim pce As PopupControlExtender = AjaxControlToolkit.PopupControlExtender.GetProxyForCurrentPopup(Page)
pce.Commit(CType(sender, Calendar).SelectedDate.ToShortDateString())
End Sub
Tab Task Bar
Mon, 28 Dec 2009 02:28:43 GMT
Posted by mfalac
First, I thought i fixed task bar :( anyway LinQ is not working in live server so i changed source to sql ere is the long boring code stil need to update >>>
<cc1:TabContainer ID="TabContainerTasks" runat="server" ActiveTabIndex="0">
<cc1:TabPanel runat="server" HeaderText="Today" ID="TabPanelToday">
<HeaderTemplate>
Today
</HeaderTemplate>
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanelTaskListView" runat="server" >
<ContentTemplate>
<asp:SqlDataSource ID="SqlDataSourceToday" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:me %>" OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [Id], [Char], [Position], [TaskName], [TaskDate], [isComplete] FROM [ReorderTaskList] WHERE ([TaskDate] = @TaskDate) ORDER BY [Position]"
UpdateCommand="UPDATE ReorderTaskList SET Position = @Position, TaskName = @TaskName, isComplete = @isComplete, TaskDate = @TaskDate WHERE (Id = @original_Id)">
<SelectParameters>
<asp:ControlParameter ControlID="LabelDateTime" DbType="Date" Name="TaskDate" PropertyName="Text" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="position" Type="Int32" />
<asp:Parameter Name="TaskName" />
<asp:Parameter Name="isComplete" />
<asp:Parameter Name="TaskDate" />
<asp:Parameter Name="original_id" Type="Int32" />
</UpdateParameters>
</asp:SqlDataSource>
<cc1:ReorderList ID="reorder" runat="server" AllowReorder="True" DataSourceID="SqlDataSourceToday" DataKeyField="Id" SortOrderField="Position" PostBackOnReorder="True" CallbackCssStyle="DragHandleClass">
<DragHandleTemplate><div class="DragHandleClass">
</div></DragHandleTemplate>
<ItemTemplate>
<cc1:HoverMenuExtender ID="HoverMenuExtenderToday" runat="server" TargetControlID="TaskNameLabel" PopupControlID="PanelToday" OffsetX="-90" OffsetY="20" >
</cc1:HoverMenuExtender>
<%
--panel here --------------%><asp:Panel ID="PanelToday" runat="server" CssClass="popupControl1" >
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"><ContentTemplate>
<asp:Label ID="LabelId" Visible="false" runat="server" Text='<%# Eval("Id") %>' />
<asp:DetailsView ID="DetailsViewpop" runat="server" AutoGenerateRows="False" DataKeyNames="Id" DataSourceID="SqlDataSourcePopUp" DefaultMode="Edit" onitemupdated="DetailsViewpop_ItemUpdated" >
<Fields>
<asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True" SortExpression="Id" Visible="False" />
<asp:BoundField DataField="TaskName" HeaderText="TaskName" SortExpression="TaskName" />
<asp:CheckBoxField DataField="isComplete" HeaderText="isComplete" SortExpression="isComplete" />
<asp:TemplateField HeaderText="TaskDate" SortExpression="TaskDate">
<EditItemTemplate>
<asp:Calendar ID="Calendar1" Width="100%" Height="100%" SelectedDate='<%# Bind("TaskDate") %>' runat="server" ShowGridLines="True" ShowDayHeader="False" TitleFormat="Month"></asp:Calendar>
</EditItemTemplate>
<InsertItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("TaskDate") %>'></asp:TextBox>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("TaskDate") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowEditButton="True" />
</Fields>
</asp:DetailsView> </ContentTemplate>
</asp:UpdatePanel> <asp:SqlDataSource ID="SqlDataSourcePopUp" runat="server" ConnectionString="<%$ ConnectionStrings:me %>" SelectCommand="SELECT Id, TaskName, isComplete, TaskDate FROM ReorderTaskList WHERE (Id = @id)" UpdateCommand="UPDATE ReorderTaskList SET TaskName = @TaskName, isComplete = @isComplete, TaskDate = @TaskDate WHERE (Id = @Id)">
<SelectParameters>
<asp:ControlParameter ControlID="LabelId" Name="id" PropertyName="Text" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="TaskName" />
<asp:Parameter Name="isComplete" />
<asp:Parameter Name="TaskDate" />
<asp:Parameter Name="Id" />
</UpdateParameters>
</asp:SqlDataSource> <br />
</asp:Panel>
<div class="DragHandleClassBody">
<asp:Label ID="TaskNameLabel" runat="server" Text='<%# Eval("TaskName") %>' />
<br /><%#DataBinder.Eval(Container.DataItem, "TaskDate", "{0:M}")%></div>
</ItemTemplate>
</cc1:ReorderList>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</
<
cc1:TabPanel>cc1:TabPanel ID="TabPanelTomorrow" runat="server" HeaderText="Tomorrow">
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanelEditAndInsert" runat="server" UpdateMode="Conditional">
<ContentTemplate>
TODP: tomorrow here
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</
cc1:TabPanel>
<cc1:TabPanel ID="TabPanelPast" runat="server" HeaderText="Past">
<ContentTemplate>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
TODO: past here
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</
cc1:TabPanel>
<cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Add">
<ContentTemplate>TODO: Add a delete Task! should delete old month or second quater>????</ContentTemplate>
</
cc1:TabPanel>
</cc1:TabContainer>