Solved

ASP.NET Calandar with nested radio buttons

Posted on 2009-06-29
4
363 Views
Last Modified: 2012-05-07
I need to replicate this in asp.net (See Link)
I am able to get radio buttons in to the day I need them in, but I cant get them to post back or do anything. Can anybody help me with this please.
 Thanks
http://www.kuoni.co.uk/holiday/africa_and_indian_ocean/maldives/velassaru_maldives/search_index.html?DPDMYD=12/07/2009&NRNTSD=7&MPLAND=RB&DPTAGD=LON&ROOMTD=067
0
Comment
Question by:JasonChandler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 4

Expert Comment

by:vbgb
ID: 24736042
I assume that you have set the AutoPostBack property to True on the radio button controls.
0
 
LVL 2

Author Comment

by:JasonChandler
ID: 24736577
@vbgb:
Hi,
Yes I Have done that, but to no avail.
The code I am using is like this. (Assume I want to add radio buttons to every 5th of any month)

Thanks


        If e.Day.Date.Day = 5 Then
            Dim R As New RadioButton
            With R
                .Text = "Radion Button"
                .GroupName = "RadioButtons"
                .EnableViewState = True
                .AutoPostBack = True
            End With
            e.Cell.Controls.Add(R)
        End If

Open in new window

0
 
LVL 2

Author Comment

by:JasonChandler
ID: 24736587
@vbgb:
Sorry forgot to say, I am using the above code on the Day Render Event of the Calandar.
0
 
LVL 4

Accepted Solution

by:
vbgb earned 250 total points
ID: 24737052
Hi Jason

I have tried out what you are trying to do and can see what the problem is.

The radio buttons seem to work in that you can select one, but the postback doesn't fire. The other major issue is that as you are dynamically creating the radio button controls in the render event, each time you change month or select a day, the postback will re-render the calendar and clear all the radio buttons - i.e their viewstate is lost because they are recreated on each day rendering.

I would suggest that what you need is some form of button to get the user to click to confirm their choice and then pick up the value in each radio button in the page load event that happens on postback.
If you do this you would need to give the radio buttons an ID so that you can read the value of them using FindControl. This is complex though as the radiobuttons are members of the calendar.cells.controls collection and I cannot find a way to enumerate the cells and then check each one for a radiobutton!!

 Sorry, this doesn't seem very helpful, but I think you may need a different approach - you should be able to use Javascript to check the values in the visible radiobuttons and then save them (in a hidden field) and do a postback to finish any server side processing.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question