Tuesday, May 13, 2008
Client side script for selected index changed of Drop Dwon list
function ddlAcquirerSelectedIndexChanged()
{
var ListBox1Id = '<%= ddlAcquirer.ClientID %>';
var TextBox1Id = '<%=txtAcquirer.ClientID %>';
var lblId='<%=lblAcquirer1.ClientID %>';
if (document.getElementById(ListBox1Id).selectedIndex >= 0)
{
var selectedIndex = document.getElementById(ListBox1Id).selectedIndex;
if(document.getElementById(ListBox1Id).options[selectedIndex].value=='Barclaycard')
{
document.getElementById(TextBox1Id).disabled=true;
document.getElementById(lblId).disabled=true;
document.getElementById('<%=lblBarclayardMerchantNo.ClientID %>').disabled=false;
document.getElementById('<%=txtBarclayardMerchantNo.ClientID %>').disabled=false;
}
else
{
document.getElementById(TextBox1Id).disabled=false;
document.getElementById(lblId).disabled=false;
document.getElementById('<%=lblBarclayardMerchantNo.ClientID %>').disabled=true;
document.getElementById('<%=txtBarclayardMerchantNo.ClientID %>').disabled=true;
}
}
And in Page load event in code behind
ddlAcquirer.Attributes.Add("onchange", "ddlAcquirerSelectedIndexChanged();")
{
var ListBox1Id = '<%= ddlAcquirer.ClientID %>';
var TextBox1Id = '<%=txtAcquirer.ClientID %>';
var lblId='<%=lblAcquirer1.ClientID %>';
if (document.getElementById(ListBox1Id).selectedIndex >= 0)
{
var selectedIndex = document.getElementById(ListBox1Id).selectedIndex;
if(document.getElementById(ListBox1Id).options[selectedIndex].value=='Barclaycard')
{
document.getElementById(TextBox1Id).disabled=true;
document.getElementById(lblId).disabled=true;
document.getElementById('<%=lblBarclayardMerchantNo.ClientID %>').disabled=false;
document.getElementById('<%=txtBarclayardMerchantNo.ClientID %>').disabled=false;
}
else
{
document.getElementById(TextBox1Id).disabled=false;
document.getElementById(lblId).disabled=false;
document.getElementById('<%=lblBarclayardMerchantNo.ClientID %>').disabled=true;
document.getElementById('<%=txtBarclayardMerchantNo.ClientID %>').disabled=true;
}
}
And in Page load event in code behind
ddlAcquirer.Attributes.Add("onchange", "ddlAcquirerSelectedIndexChanged();")
Monday, May 12, 2008
Friday, May 9, 2008
calander extender Ajax Control
Tip 3: Enable Year Navigation in CalendarExtender
When the calendar appears, click on the title of the calendar to change the view to Months in the current year. Clicking it again, switches the view to Years, showing 10 years at a time.
If you plan to do this programmatically, here’s some code for you. Use the OnClientShown event and switch the mode using javascript. This tip was shared by one of the Microsoft® support person at the asp.net forums.
runat="server" TargetControlID="TextBox1" OnClientShown="ChangeCalendarView" />
Then add this to the section
CalendarExtender
When the calendar appears, click on the title of the calendar to change the view to Months in the current year. Clicking it again, switches the view to Years, showing 10 years at a time.
If you plan to do this programmatically, here’s some code for you. Use the OnClientShown event and switch the mode using javascript. This tip was shared by one of the Microsoft® support person at the asp.net forums.
Then add this to the section
Wednesday, May 7, 2008
Tuesday, May 6, 2008
Selecting the row based on the row number in sql server 2005
select * from (SELECT ROW_NUMBER() OVER (ORDER BY pkuserid ASC) AS ROWID, * FROM users) as t where t.rowid=3
Subscribe to:
Posts (Atom)