Hi,
I have downloaded the mojo portal build version 2.3.16.
I needed a custom feature module to be added into one of our page, so i created an user control (an ascx file), in which i have dragged Drop down list control onto the page,set its AutoPostBack property to true and on the SelectedIndexChanged event of the same control i have write a simple code to change the selected index, i have notice a weird thing that on changing the index of the drop down list the page is posted back but the event DropDownList1_SelectedIndexChanged is not executed.
The page is inheriting from the SiteModuleControl class.
Sample Code.
SampleDD.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SampleDD.ascx.cs" Inherits="WebStore.UI.WebStore.RRShopControls.SampleDD" %>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
onselectedindexchanged="DropDownList1_SelectedIndexChanged">
</asp:DropDownList>
--------------------------------------------------------------------------------
SampleDD.ascx.cs
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;
using WebStore.Business;
using mojoPortal.Web;
namespace WebStore.UI.WebStore.RRShopControls
{
public partial class SampleDD : SiteModuleControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
DropDownList1.DataSource = MembershipSevice.GetCountries();
DropDownList1.DataTextField = "CountryName";
DropDownList1.DataValueField = "CountryID";
DropDownList1.DataBind();
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList1.SelectedIndex = 1;
}
}
}
----------------------------------------------------------------------------------------