Hi To All,
I want to show popup calender control in my website. How to do that?
Plz help

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.

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.

.

.

.

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 !

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

u can try to use ASP AJAX

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

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.

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 .

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...?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.