In my calandar_select ionchanged event .. am showing a div region in my page on the top of the calendar .
Like www.bytes.com on clicking Login You will find a small page opens similarly which i want
Sameway, i want to open a div region on below to the selected date...how can it be made ..
am using vs2005 vb.net code ajax ...
This is the div region should open on every calendar_select ionchanged event...
[code=html]
<div id="daydetail" runat="server" visible="false" >
<h2>Details for <span id="selectedday " runat="server" /></h2>
<span id="daydetail_r ender" runat="server" />
<asp:TextBox ID="TextBox2" runat="server"> </asp:TextBox>
<asp:TextBox ID="TextBox3" runat="server"> </asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>[/code]
vb.net
Like www.bytes.com on clicking Login You will find a small page opens similarly which i want
Sameway, i want to open a div region on below to the selected date...how can it be made ..
am using vs2005 vb.net code ajax ...
This is the div region should open on every calendar_select ionchanged event...
[code=html]
<div id="daydetail" runat="server" visible="false" >
<h2>Details for <span id="selectedday " runat="server" /></h2>
<span id="daydetail_r ender" runat="server" />
<asp:TextBox ID="TextBox2" runat="server"> </asp:TextBox>
<asp:TextBox ID="TextBox3" runat="server"> </asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>[/code]
vb.net
Code:
Public Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As EventArgs)
myCommand = New SqlCommand("Date1", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
Dim parameter_Date As New SqlParameter("@_Date", SqlDbType.DateTime, 8)
parameter_Date.Value = Calendar1.SelectedDate
myCommand.Parameters.Add(parameter_Date)
myConnection.Open()
myDataReader = myCommand.ExecuteReader()
Dim temp As String = ""
While (myDataReader.Read())
temp &= "Title : <a href=""somepage.aspx?ID=" & myDataReader.Item("id") & """>" & myDataReader.Item("Country") & "</a><br><br>Email : " & myDataReader.Item("State") & "<br>" ' This Is the div region which ll be displayed
End While
daydetail.Visible = True
daydetail_render.InnerHtml = temp
myDataReader.Close()
myConnection.Close()
selectedday.InnerHtml = Calendar1.SelectedDate.ToString("MMM d, yyyy")
tempDate = Calendar1.SelectedDate
Get_DBItems()
End Sub
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Calendar1" EventName="SelectionChanged" />
</Triggers>
<ContentTemplate>
<div id="daydetail" runat="server" visible="false">
<h2>Details for <span id="selectedday" runat="server" /></h2>
<span id="daydetail_render" runat="server" />
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
<asp:Calendar OnDayRender="Calendar1_DayRender"
OnSelectionChanged="Calendar1_SelectionChanged"
OnVisibleMonthChanged="MonthChanged"
Runat="server" id="Calendar1">
</asp:Calendar><br><br>
<asp:TextBox ID="TextBox1" runat="server" Style="position: relative"></asp:TextBox>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
Comment