How to make selected index zero for dropdownlist in java script..?
in my application there is link button when i click the link button popup window will be opened
in that i have one dropdown values like
--select--
karthik
ashwini
when i select any item in dropdown like karthik in dropdown when i close the popup window
again when i opend the popup text --select-- not showing karthik is showing how to make selected index zero plz help m
Loading
Satyapriya NayakPosted Dec 23, 2011, 10:55 PM
Try this...
Run the attachments.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace WebApplication1
{
public partial class _Default : System.Web.UI.Page
{
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
namespace WebApplication1
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
DropDownList1.Items.Add("select");
DropDownList1.Items.Add("karthik");
DropDownList1.Items.Add("ashwini");
}
}
}
Thanks
If this post helps you mark it as answer