Link to home
Start Free TrialLog in
Avatar of Rajar Ahmed
Rajar AhmedFlag for India

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of SunnyDark
SunnyDark
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rajar Ahmed

ASKER

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..?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

  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.    


This worked thanks .
textbox2.Attributes("onfocus") ="showCalendarControl(this);"

Thanks :)