CascadingDropDown
Tue, 17 Nov 2009 03:20:09 GMT
Posted by mfalac
<div>
Vendor: <asp:DropDownList ID="VendorsList" runat="server" />
</div>
<cc1:CascadingDropDown ID="ccd1" runat="server"
ServicePath="~/CascadingDropDown0.asmx" ServiceMethod="GetVendors"
TargetControlID="VendorsList" Category="Vendor">
</cc1:CascadingDropDown>
WebService codes:
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Web.Script.Services
Imports AjaxControlToolkit
Imports System.Collections.Generic
<ScriptService()> _
Public Class CascadingDropDown0
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function GetVendors(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
Dim l As New List(Of CascadingDropDownNameValue)
l.Add(New CascadingDropDownNameValue("International", "1"))
l.Add(New CascadingDropDownNameValue("Electronic Bike Repairs & Supplies", "2"))
l.Add(New CascadingDropDownNameValue("Premier Sport, Inc.", "3"))
Return l.ToArray()
End Function
End Class
dropdown list
Wed, 18 Nov 2009 02:24:13 GMT
Posted by mfalac
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Web.Script.Services
Imports AjaxControlToolkit
Imports System
Imports System.Collections.Generic
Imports System.Collections.Specialized
Imports System.Data.SqlClient
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<System.Web.Script.Services.ScriptService()> _
Public Class CascadingDropdown1
Inherits System.Web.Services.WebService
Public Function GetVendors(ByVal knownCategoryValues As String, ByVal category As String) As CascadingDropDownNameValue()
Dim conn As New SqlConnection("server=")
conn.Open()
Dim comm As New SqlCommand( _
"SELECT TOP 25 ArticleId, ArticleTitle FROM BlogArticles", conn)
Dim dr As SqlDataReader = comm.ExecuteReader()
Dim l As New List(Of CascadingDropDownNameValue)
While (dr.Read())
l.Add(New CascadingDropDownNameValue(dr("ArticleTitle").ToString(), dr("ArticleId").ToString()))
End While
conn.Close()
Return l.ToArray()
End Function
End Class
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
date control Dynamically Populating a Control Using JavaScript Code
Wed, 18 Nov 2009 05:01:41 GMT
Posted by mfalac
<cc1:DynamicPopulateExtender ID="dpe1" runat="server"
ClearContentsDuringUpdate="true"
TargetControlID="myDate" ServicePath="~/timeFormat.asmx"
ServiceMethod="getDate" >
</cc1:DynamicPopulateExtender>
<asp:Panel ID="panel1" runat="server">
<asp:Label ID="myDate" runat="server" Text="Label"></asp:Label><br />
<input type="radio" id="rb1" name="format" value="format1" runat="server"
onclick="$find('dpe1').populate(this.value);" />m-d-y
<input type="radio" id="rb2" name="format" value="format2" runat="server"
onclick="$find('dpe1').populate(this.value);" />d.m.y
<input type="radio" id="rb3" name="format" value="format3" runat="server"
onclick="$find('dpe1').populate(this.value);" />Just year
</asp:Panel>
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Web.Script.Services
<ScriptService()> _
Public Class timeFormat
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function getDate(ByVal contextKey As String) As String
Dim myDate As String = ""
Select Case contextKey
Case "format1"
myDate = String.Format("{0:MM}-{0:dd}-{0:yyyy}", DateTime.Now)
Case "format2"
myDate = String.Format("{0:dd}.{0:MM}.{0:yyyy}", DateTime.Now)
Case "format3"
myDate = String.Format("{0:yyyy}", DateTime.Now)
End Select
Return myDate
End Function
End Class
Databinding to an Accordion
Wed, 25 Nov 2009 05:35:05 GMT
Posted by mfalac
try it here
some reason default margin value is em so you have to overwrite it!
.accordionHeader
{
border: 1px solid #00000;
color: black;
font-family: Arial, Sans-Serif;
font-size: 12px;
font-weight: bold;
padding: 5px;
margin-top: 5px;
cursor: pointer;
margin: 3px;
background: url(images/img07.gif) repeat-x;
}
.accordionContent
{
background-color: white;
border-top: none;
padding: 5px;
padding-top: 10px;
margin: 1px;
border-style: dashed;
border-width: 1px;
border-color: #2F4F4F;
}
and
<cc1:Accordion ID="Accordion2" runat="server"
SelectedIndex="0"
HeaderCssClass="accordionHeader"
HeaderSelectedCssClass="accordionHeader"
ContentCssClass="accordionContent"
AutoSize="None"
FadeTransitions="True"
TransitionDuration="250"
FramesPerSecond="40"
RequireOpenedPane="False"
SuppressHeaderPostbacks="true" DataSourceID="SqlDataSource1">
<HeaderTemplate>
<h4>
<%#(DataBinder.Eval(Container.DataItem, "Title"))%></h4>
</HeaderTemplate>
<ContentTemplate>
<%#(DataBinder.Eval(Container.DataItem, "Title"))%>
<br />
Posted by <%#(DataBinder.Eval(Container.DataItem, "UserName"))%> on
<%#(DataBinder.Eval(Container.DataItem, "Date"))%>
<p>
<%#(DataBinder.Eval(Container.DataItem, "Content"))%>
</p>
</ContentTemplate>
</cc1:Accordion>
Animation
Sun, 29 Nov 2009 02:31:12 GMT
Posted by mfalac
<cc1:AnimationExtender ID="ae" runat="server" TargetControlID="Button1">
<Animations>
<OnClick>
<Sequence>
<EnableAction Enabled="false" />
<Parallel>
<FadeOut Duration="1.5" Fps="24" AnimationTarget="Panel1" />
<Resize Width="1000" Height="150" Unit="px"
AnimationTarget="Panel1" />
</Parallel>
</Sequence>
</OnClick>
</Animations>
</cc1:AnimationExtender>
<hr />
<asp:Panel ID="Panel1" runat="server" CssClass="panelClass">
ASP.NET AJAX is a free framework for quickly creating a new generation of more
efficient, more interactive and highly-personalized Web experiences that work
across all the most popular browsers.<br />
ASP.NET AJAX is a free framework for quickly creating a new generation of more
efficient, more interactive and highly-personalized Web experiences that work
across all the most popular browsers.<br />
ASP.NET AJAX is a free framework for quickly creating a new generation of more
efficient, more interactive and highly-personalized Web experiences that work
across all the most popular browsers.<br />
</asp:Panel>
<input id="Button1" runat="server" type="button" value="button" />
<cc1:AnimationExtender id="MyExtender"
runat="server" TargetControlID="Button1">
<Animations>
<OnClick>
<Sequence>
<EnableAction Enabled="false" />
<Color AnimationTarget="Panel1"
Duration="1"
StartValue="#FF0000"
EndValue="#666666"
Property="style"
PropertyKey="backgroundColor" />
<Color AnimationTarget="Panel1"
Duration="1"
StartValue="#FF0000"
EndValue="#666666"
Property="style"
PropertyKey="backgroundColor" />
<EnableAction Enabled="true" />
</Sequence>
</OnClick>
</Animations>
</cc1:AnimationExtender>
LoginStatus
Mon, 30 Nov 2009 03:58:43 GMT
Posted by mfalac
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadIf Request.IsAuthenticated Then
LoginStatus1_ModalPopupExtender.Enabled =
False
Else
LoginStatus1_ModalPopupExtender.Enabled =
True
LoginStatus1_ModalPopupExtender.Show()
End If
End Sub
LoginStatus1_ModalPopupExtender.Hide()
Protected Sub btnCancel_Click(ByVal sender As Object, ByVal e As System.EventArgs)End Sub
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
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>