Hello, Everyone
Please can you help me out with this in (VB)...?
I have a form with a calendarExtendar. When I select a date, and a postback happens I lose the selected date value.
Also when I try and insert I get the todays value and not the selected one..
You have any suggestions?
After deleting everything and starting again it works ….very strange
The problem was not solved by deleting everything…. But it help me find out where the problem actually is! The problem lies with the image pop up for the calendar control …. Delete that and you will stop getting the current date after postback… If you know the solution is let me know…
Post some code...though the post back problem sounds more like you have forgotten to put the load methods inside an "If(!Page.IsPostBack)" block.
Ignore
As requested.... Please can you explain further or suggest some reading about "load methods inside an "If(!Page.IsPostBack)"
ProtectedSub SqlDataSource1_Inserting(ByVal senderAsObject,ByVal eAs System.Web.UI.WebControls.SqlDataSourceCommandEventArgs)
Dim Textbox22As TextBox = FormView1.FindControl("TextBox22")Dim Textbox1As TextBox = FormView1.FindControl("TextBox1")
Dim sDateTimeAsString =CStr(Textbox22.Text) +" " +CStr(Textbox1.Text)Dim OpenDateTimeAsDate = DateTime.Parse(sDateTime)e.Command.Parameters("@.OpenDateTime").Value = OpenDateTime
EndSub
<tr>
<tdnowrap="nowrap"style="width: 235px">
System Target Date of Resolution</td>
<tdstyle="width: 390px">
<asp:TextBoxID="TextBox22"runat="server"Style="position: static"</asp:TextBox>
<asp:Imagerunat="Server"ID="Image2"ImageUrl="~/images/Calendar_scheduleHS.png"/>
<asp:RequiredFieldValidatorID="RequiredFieldValidator8"runat="server"ControlToValidate="TextBox22"
ErrorMessage="Select Target date"Style="position: static"InitialValue="Select Date">*</asp:RequiredFieldValidator>
<cc1:CalendarExtenderID="CalendarExtender2"runat="server"
TargetControlID="textbox22"
PopupButtonID="Image2"Format="dd MMM yyyy"CssClass="Calendar">
</cc1:CalendarExtender>
</td>
</tr>
<tr>
<tdnowrap="nowrap"style="width: 235px; height: 21px">
System Target Time of Resolution</td>
<tdstyle="width: 390px; height: 21px">
<asp:TextBoxID="TextBox1"runat="server"Style="position: static" </asp:TextBox>
<asp:RequiredFieldValidatorID="RequiredFieldValidator9"runat="server"ControlToValidate="TextBox1"
ErrorMessage="Select Target Date"Style="position: static"InitialValue="Enter Time HH:MM">*</asp:RequiredFieldValidator></td>
<cc1:MaskedEditExtenderID="MaskedEditExtender3"
runat="server"
TargetcontrolID="TextBox1"
Mask="99:99"
Masktype=TimeMessageValidatortip=True
AcceptAMPM=False
/>
</tr>
No comments:
Post a Comment