I have a calender control where I am populating all the shifts from db .This works fine with firstname last name and shift data(ex : john 5-11). While I click on link I am opening a modular pop up I need datagrid populating all the corresponding data for
that day .
Currently when I click on link the label1.Text gets dispalyed in popup .But not the gridview data as label1.text is not picking up in sql query from sqldatasource. can anyone point me as to how do I go about getting label1.text value.
my Code :
Sub
DayRender(ByVal
sender AsObject,
ByVal
e AsDayRenderEventArgs)
Dim
dayTextChanged AsBoolean=
False
Dim
calDate AsDateTime=
e.Day.Date
For Each
dr In
ds.Tables(0).Rows
Dim
dtEvent AsDateTime
= CType(dr("date"),
DateTime)
<asp:GridViewID="GridView1"DataSourceID="SqlDataSource1"runat="server"/><asp:SqlDataSourceID="SqlDataSource1"runat="server"
SelectCommand="select top 4 c.uid,c.date,c.timestart,c.timeend,p.Firstname,p.Lastname from CAL_schedule_slots c inner join ProviderMasterBase
p ON c.uid=p.webid where c.date=@date1"ConnectionString="<%$
ConnectionStrings:conn %>">
lovedotnet08
Member
2 Points
3 Posts
Calender Control and Modalpopup onclick event
Sep 06, 2011 08:24 PM|LINK
Hi ,
Client Project :
I have a calender control where I am populating all the shifts from db .This works fine with firstname last name and shift data(ex : john 5-11). While I click on link I am opening a modular pop up I need datagrid populating all the corresponding data for that day .
Currently when I click on link the label1.Text gets dispalyed in popup .But not the gridview data as label1.text is not picking up in sql query from sqldatasource. can anyone point me as to how do I go about getting label1.text value.
my Code :
Sub DayRender(ByVal sender As Object, ByVal e As DayRenderEventArgs)
Dim dayTextChanged As Boolean= False
Dim calDate As DateTime= e.Day.Date
For Each dr In ds.Tables(0).Rows
Dim dtEvent As DateTime = CType(dr("date"), DateTime)
Dim
lb As New LinkButton()
lb.Text ="<u>" + dr("Firstname") + dr("Lastname") + " " + " " + dr("timestart").ToString() + "-" + dr("timeend").ToString() + "</u>"+ "<br />"
e.Cell.Controls.Add(lb)
e.Cell.Attributes("onclick") = "popupModal('"& e.Day.[Date].ToString() & "');"
End if
Next
From Client side :
<script type="text/javascript">
function popupModal(value) {
$get('<%=Label1.ClientID %>').innerText = value
$find('programmaticModalPopupBehavior').show();
}
</script>
Code :
<asp:ModalPopupExtender runat="server" ID="programmaticModalPopup" BehaviorID="programmaticModalPopupBehavior"TargetControlID="hiddenTargetControlForModalPopup" PopupControlID="programmaticPopup" CancelControlID="CancelButton" BackgroundCssClass="modalBackground" DropShadow="True" RepositionMode="RepositionOnWindowScroll"><asp:Label ID="Label1" runat="server"></asp:Label><br />
<asp:GridView ID="GridView1" DataSourceID="SqlDataSource1" runat="server"/><asp:SqlDataSource ID="SqlDataSource1" runat="server" SelectCommand="select top 4 c.uid,c.date,c.timestart,c.timeend,p.Firstname,p.Lastname from CAL_schedule_slots c inner join ProviderMasterBase p ON c.uid=p.webid where c.date=@date1"ConnectionString="<%$ ConnectionStrings:conn %>">
<SelectParameters>
<asp:ControlParameter Name="date1" ControlID="label1" />
</SelectParameters>
</asp:SqlDataSource>
How do I get Control parameter to popualte label1.text values .
Thank you,
Neha