6
Contributors
12
Replies
13
Views
8 Years
Discussion Span
Last Post by sakhi kul
0

First thing, go to your toolbox and Add a Calender control , set the visibility to false, and add a textbox where there value will be passed too and a link button to invoke the calender. in the click event of your link button make the visibility of the calender to be true and when a user clicks the Calender , in the Calenders selected event write a code to take the selected date to the textbox and after that a code to change the visibility of the calender control to false.

Hope this helps.

0

hi..

vuyiswamb's method is right. you can even use this method.

take your calender control on a different form. and on event,say button click event,call the form by Javascript. Following is the code for the same.

protected void btnCalShow_Click(object sender, EventArgs e)
    {
     
string str="<Script> window.open('form2.aspx','mywinodw','height=300,width=300') </script>";
Response.Write(str)
    }

on form2.aspx, place your calender control & set the selected value in the session so that it will be accessible in your main form. you can even set the properties like menubar,statusbar,resizable etc of the form in the same line.

hope this will help you.

Edited by love_dude1984: n/a

0

Hi,
Actually i set calender on another form & retrive date via querystring . It appears in textbox but It converts into string. I want to again convert it into Date , so how to check that. b'coz further i want to check data for validation..

plz help me !

0

Hi,
Actually i set calender on another form & retrive date via querystring . It appears in textbox but It converts into string. I want to again convert it into Date , so how to check that. b'coz further i want to check data for validation..

plz help me !

DateTime date = Convert.ToDateTime(txtdate.Text);
        if(date>DateTime.Now)
        txtEnteredDate.Text = "Selected date is greater";

Hope this helps

0
DateTime date = Convert.ToDateTime(txtdate.Text);
        if(date>DateTime.Now)
        txtEnteredDate.Text = "Selected date is greater";

Hope this helps

i hope your requirement was to translate the date captured in string datetime.

P.S Mark the thread as solved if your query is resolved

0

Apart from ASP.NET calendar control, you can also try Ajax Calender Extender that can be attached to any ASP.NET TextBox control.

Try this link.

0

Hi,
Thanks for your suggestion but I am using VB as . So I have tried conversion using Ctype, but it gives me error that String can not be converted to DateTime .

0

Thanks for reply,
but I need code using VB.
I am converting String value using Ctype but it gives me error that you cannot convert String to Datetime...

can anybody know same code using VB...?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.