We help IT Professionals succeed at work.

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

Medium Priority
516 Views
Last Modified: 2013-11-07
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

Comment
Watch Question

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Rajar AhmedConsultant
CERTIFIED EXPERT

Author

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..?
Sure there is!
In the code behind:
mytextbox.Attributes["onfocus"] ="showCalendarControl(this);"

Rajar AhmedConsultant
CERTIFIED EXPERT

Author

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.    


Rajar AhmedConsultant
CERTIFIED EXPERT

Author

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

Rajar AhmedConsultant
CERTIFIED EXPERT

Author

Commented:
Thanks :)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.