I figured the problem. It had to do with the submit buttons name being
"Steven Cheng[MSFT]" <v-schang@online.microsoft.com> wrote in message
news:EASHgRx5DHA.568@cpmsftngxa07.phx.gbl...
> Hi Girish,
>
>
> Thanks for posting in the community!
> From your description, you used a ASP.NET DropDownList in a web form and
it
> it set as AutoPostBack = true so as to capture it's selectedindeschanged
> serverside event. However, when running the page, you found that there
> occured the below error:
> The error is :"JScript Runtime error: Object dosent support this property
or
> method"
> at the clientside script , yes?
>
> If there is anything I misunderstood, please feel free to let me know.
>
>
> Based on my experience, such odd errors is likely caused by some
unexpected
> things. Have you ever met such errors before or is it a common situation?
I
> recommend that you try the following steps:
> 1. Try creating a new simple page and add a DropDownList to test its
> SelectedindexChanged event. If ok, you 'll check the difference bewteen
> the two pages.
>
> 2. Trying do the same test on a certain page in other project. If the
> problem goes away, try checking if there're any difference between the two
> pages.
>
> Also, here is a test page I used to test on my side, you may try testing
on
> it if you feel necessary:
> -------------------------------------aspx
> page----------------------------------------
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
> <HTML>
> <HEAD>
> <title>DropDownList</title>
> <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
> <meta content="C#" name="CODE_LANGUAGE">
> <meta content="JavaScript" name="vs_defaultClientScript">
> <meta content="
http://schemas.microsoft.com/intellisense/ie5" > name="vs_targetSchema">
> </HEAD>
> <body>
> <form id="Form1" method="post" runat="server">
> <table width="500" align="center">
> <tr>
> <td>Category:
> <asp:dropdownlist id="lstCategory" runat="server" AutoPostBack="True">
> <asp:ListItem Value="Student" Selected="True">Student</asp:ListItem>
> <asp:ListItem Value="Teacher">Teacher</asp:ListItem>
> </asp:dropdownlist></td>
> </tr>
> <tr>
> <td><asp:panel id="pnlStudent" runat="server" Visible="True">
> <TABLE>
> <TR>
> <TD colSpan="2">
> <asp:Label id="lblTitleS" runat="server">Student's
> Info</asp:Label></TD>
> </TR>
> <TR>
> <TD>
> <asp:Label id="Label1" runat="server">ID:</asp:Label></TD>
> <TD>
> <asp:TextBox id="TextBox1" runat="server"></asp:TextBox></TD>
> </TR>
> <TR>
> <TD>
> <asp:Label id="Label2" runat="server">Name:</asp:Label></TD>
> <TD>
> <asp:TextBox id="TextBox2" runat="server"></asp:TextBox></TD>
> </TR>
> </TABLE>
> </asp:panel></td>
> </tr>
> <tr>
> <td><asp:panel id="pnlTeacher" runat="server" Visible="False">
> <TABLE>
> <TR>
> <TD colSpan="2">
> <asp:Label id="lblTitleT" runat="server">Teacher's
> Info</asp:Label></TD>
> </TR>
> <TR>
> <TD>
> <asp:Label id="Label3" runat="server">ID:</asp:Label></TD>
> <TD>
> <asp:TextBox id="TextBox3" runat="server"></asp:TextBox></TD>
> </TR>
> <TR>
> <TD>
> <asp:Label id="Label4" runat="server">Name:</asp:Label></TD>
> <TD>
> <asp:TextBox id="TextBox4" runat="server"></asp:TextBox></TD>
> </TR>
> </TABLE>
> </asp:panel></td>
> </tr>
> </table>
> </form>
> </body>
> </HTML>
>
>
> -----------------------------code behind page
> class----------------------------
> public class DropDownList : System.Web.UI.Page
> {
> protected System.Web.UI.WebControls.DropDownList lstCategory;
> protected System.Web.UI.WebControls.Panel pnlStudent;
> protected System.Web.UI.WebControls.Label Label1;
> protected System.Web.UI.WebControls.Label Label2;
> protected System.Web.UI.WebControls.TextBox TextBox1;
> protected System.Web.UI.WebControls.TextBox TextBox2;
> protected System.Web.UI.WebControls.TextBox TextBox3;
> protected System.Web.UI.WebControls.TextBox TextBox4;
> protected System.Web.UI.WebControls.Label Label3;
> protected System.Web.UI.WebControls.Label Label4;
> protected System.Web.UI.WebControls.Label lblTitleS;
> protected System.Web.UI.WebControls.Label lblTitleT;
> protected System.Web.UI.WebControls.Panel pnlTeacher;
>
> private void Page_Load(object sender, System.EventArgs e)
> {
> }
>
> #region Web Form Designer generated code
> override protected void OnInit(EventArgs e)
> {
> InitializeComponent();
> base.OnInit(e);
> }
>
> /// <summary>
> /// Required method for Designer support - do not modify
> /// the contents of this method with the code editor.
> /// </summary>
> private void InitializeComponent()
> {
> this.lstCategory.SelectedIndexChanged += new
> System.EventHandler(this.lstCategory_SelectedIndexChanged);
> this.Load += new System.EventHandler(this.Page_Load);
>
> }
> #endregion
>
> private void lstCategory_SelectedIndexChanged(object sender,
> System.EventArgs e)
> {
> if(lstCategory.SelectedValue.Equals("Teacher"))
> {
> pnlTeacher.Visible = true;
> pnlStudent.Visible = false;
> }
> else
> {
> pnlTeacher.Visible = false;
> pnlStudent.Visible = true;
> }
> }
> }
> ------------------------------------------------------------
>
> Please try out the preceding suggestions. If you need any assistance,
> please feel free to post here.
>
>
>
> Regards,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure!
www.microsoft.com/security > (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>