Sunday, May 31, 2009

Use Of Accordian in ASP.NET?

Design :

UpdatePanel ID="updateCustomer" runat="server"
ContentTemplate
asp:PlaceHolder ID="phCustomerTestimonial" runat="server asp:PlaceHolder
ContentTemplate
asp:UpdatePanel


Codding Part:
Accordion customerTestimonialsAccordion = new Accordion();


MemberService memberService = new MemberService();
MemberData.FeedbackDataTable feedback = new MemberData.FeedbackDataTable();
int i = 0;
customerTestimonialsAccordion.ID = "customerTestimonialsAccordion";
customerTestimonialsAccordion.SelectedIndex = 0;
customerTestimonialsAccordion.FadeTransitions = true;
customerTestimonialsAccordion.FramesPerSecond = 50;
customerTestimonialsAccordion.TransitionDuration = 250;
customerTestimonialsAccordion.SuppressHeaderPostbacks = true;
feedback = memberService.GetTestimonial();
DataView feedBackView = new DataView(feedback);
foreach (DataRowView feedbackRowView in feedback)
{
AccordionPane accordionPane = new AccordionPane();
LinkButton parentCustomerTestimonial =new LinkButton();
parentCustomerTestimonial.Text = feedbackRowView["FeedbackDescription"].ToString();
parentCustomerTestimonial.ID = feedbackRowView["FeedbackID"].ToString();
accordionPane.HeaderContainer.Controls.Add(parentCustomerTestimonial);
customerTestimonialsAccordion.Panes.Add(accordionPane);
i += 1;
}
phCustomerTestimonial.Controls.Add(customerTestimonialsAccordion);
}

Monday, May 25, 2009

How to handle events using java script?

function KeyPressed()
{
document.onkeydown = keydown;
function keydown(evt)
{
if (!evt)
evt = event;
if(evt.keyCode == 46 evt.keyCode == 8)
{
var value = document.getElementById('<%= txtValue.ClientID %>').value;
var show =parseInt(value );
if(show < 250)
{
document.getElementById('<%= txtValue.ClientID %>').innerText = show + 1;
}
}
else if(evt.keyCode != 37 evt.keyCode != 38 evt.keyCode != 39 evt.keyCode != 40)
{
var value = document.getElementById('<%= txtValue.ClientID %>').value;
var show = value-1;
document.getElementById('<%= txtValue.ClientID %>').innerText = show;
}
alert(evt.keyCode);
//return false;
}
}