Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript VB.NET
Hi,
 
I want to set calender extender textbox so that if i chose current date from other textbox calender extender the next calender extender should automatically set to 27 jan 2012.Plz help
 

Regards Sofia
Posted 27-Sep-12 0:40am
sofia3727
Comments
sofia3 at 27-Sep-12 5:43am
   
that is four month plus
challengeTo at 27-Sep-12 6:29am
   
Provide more details about exact what you want this is not a meaningful question..
 
if you have two calenders then their is no need to change the date of second calender as first because u want in both calender same date then their is no need..because both calender start with same date (current date ) by default
sofia3 at 27-Sep-12 6:37am
   
I dont want same date in both calendar..i juzt want that my second calender would alwaz show 4 month plus date from first calendar...and it depend on the client selection of first calendar date..hope so now its clear plz help
challengeTo at 27-Sep-12 6:46am
   
woh its very simple..i will give you sample code, means you wants..if in first calender i have selected 27-09-2012 then second calender must be start with 27-12-2012
 
is it.? u have using ajax calender extender..?
sofia3 at 27-Sep-12 6:55am
   
yes..i want 27-01-2013 means four month ..it will show by defauly jan month if user select back date then its ok
sofia3 at 27-Sep-12 6:56am
   
yes i am using ajax cal ext..I will be grateful if it really work
challengeTo at 27-Sep-12 7:04am
   
wait dear i am testing on my machine
sofia3 at 27-Sep-12 7:35am
   
ok
FlyingBird_ at 27-Sep-12 8:19am
   
Please check i have given one solution for you..or just hint..
 
just do one thing bcoz i have no time..
 
take a one variable and assign the value of extender1 i.e selected extender1 date + 4 months.. and assign above varible to extender.Startdate=Varible_name;
ok
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

you can get some Idea From This code...and change it according to your requirement..to implement this u need a Latest Version 4.0 of Ajax control Toolkit
 
this is the .aspx page
 

<body>
    <form id="form1" runat="server">
    <asp:scriptmanager id="ScriptManager1" runat="server" xmlns:asp="#unknown">
    </asp:scriptmanager>
    <table>
    <tr>  <td> From Date</td>
    <td> <asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown"></asp:textbox>
        <asp:calendarextender id="CalendarExtender1" runat="server" xmlns:asp="#unknown">
            Enabled="True" TargetControlID="TextBox1"  Format="dd/MM/yyyy">
            </asp:calendarextender>
        </td>
    </tr> 
       <tr><td>To Date</td> 
       <td> <asp:textbox id="TextBox2" xmlns:asp="#unknown">
            runat="server"></asp:textbox>
             <asp:calendarextender id="CalendarExtender2" runat="server" xmlns:asp="#unknown">
               Enabled="True" TargetControlID="TextBox2" Format="dd/MM/yyyy"></asp:calendarextender>
          </td>   </tr>     </table>
   
    </form>
</body>
 
 
and simply add this code on page load the .cs file is
 
  protected void Page_Load(object sender, EventArgs e)
    {
 
     CalendarExtender1.StartDate = DateTime.Now;
     CalendarExtender2.StartDate = DateTime.Now.AddMonths(1);
        
    }
 
 
In the above example First calender start with current date and second calender start after one month from current date..
 
i hope this will give you a some hint
 
thanks
  Permalink  
Comments
FlyingBird_ at 27-Sep-12 8:20am
   
Please check i have given one solution for you..or just hint.. just do one thing bcoz i have no time.. take a one variable and assign the value of extender1 i.e selected extender1 date + 4 months to that variable.. and assign above varible to extender2.Startdate=Varible_name; ok
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
 
<asp:CalendarExtender ID="TextBox1_CalendarExtender" runat="server"
    Enabled="True" TargetControlID="TextBox1">
</asp:CalendarExtender>
 
extBox1.Text = DateTime.Now.ToString("dd-MMM-yyyy");
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Is it fixed that you want to set "27 jan 2012" in second textbox (In all cases).?.
  Permalink  
v2
Comments
sofia3 at 27-Sep-12 6:28am
   
no actually it depends upon start date calendar extender textbox

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 440
1 OriginalGriff 194
2 BillWoodruff 170
3 Zoltán Zörgő 165
4 Maciej Los 163
0 OriginalGriff 7,934
1 DamithSL 6,084
2 Sergey Alexandrovich Kryukov 5,449
3 Maciej Los 5,174
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 27 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100