• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 507
  • Last Modified:

need to enter date in text box . using calendar control but page refreshes

created a form , where a date should be entered in textbox,
so, used the dotnet calendar control  but in that , found  everytime i change the month , the entire page is refreshing how to avoid the page refresh .  and also is there any tool  to select time to enter in text box. ? how to avoid page refreshes...because  found page refreshing when clicking linkbutton also..... any efficient way is there to avoid unneccessary page refresh .. plz suggest ...
Am using Vs 2005 vb.net .....



<td style="width: 114px; height: 67px">
                    <asp:TextBox ID="textbox1" runat="server" Style="position: relative; left: -3px; top: 10px;"></asp:TextBox>
                    <asp:LinkButton ID="LinkButton2" runat="server" Style="left: 152px; position: relative;
                        top: -10px">calendar</asp:LinkButton>
                </td>
                <td style="width: 114px; height: 67px">
                    <asp:Calendar ID="Calendar2" runat="server" visible="false" Style="position: relative"></asp:Calendar>
                </td>
 
 
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Calendar1.Visible = False
    End Sub

Open in new window

0
Rajar Ahmed
Asked:
Rajar Ahmed
  • 4
  • 2
2 Solutions
 
Rajar AhmedConsultantAuthor Commented:
https://engineering.purdue.edu/ECN/Support/KB/Docs/JavascriptCalendar

i used this tool, as per the instruction . i downloaded the code and linked d two file
 but there is no onfocus for the asp:textbox control ..?how can i do for this..?
0
 
SunnyDarkCommented:
Sure there is!
In the code behind:
mytextbox.Attributes["onfocus"] ="showCalendarControl(this);"

0
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

 
Rajar AhmedConsultantAuthor Commented:

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        textbox2.Attributes["onfocus"] ="showCalendarControl(this);"
    End Sub

Getting this error...

  1.Property access must assign to the property or use its value.    
  2.Identifier expected.    


0
 
Rajar AhmedConsultantAuthor Commented:
This worked thanks .
textbox2.Attributes("onfocus") ="showCalendarControl(this);"

0
 
Rajar AhmedConsultantAuthor Commented:
Thanks :)
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now