Home All Groups Group Topic Archive Search About

Web UserControl DropDownlist control event not working...

Author
10 Mar 2006 4:25 AM
den 2005
Hi everybody,
   I created a web user control and put this on a web application on same
project. But the dropdownlist selectedindexchanged event is not working. That
is first part of task, the next is to get the values of the dropdownlist of
this user control to be used in web application. How could I fixed this
problem? Thanks in advanced.

User Control
[code]
Private Months As String() = {"01", "02", "03", "04", "05", "06", "07",
"08", "09", "10", "11", "12"}
    Private Days1 As String() = {"01", "02", "03", "04", "05", "06", "07",
"08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
"21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"}
    Private Days2 As String() = {"01", "02", "03", "04", "05", "06", "07",
"08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
"21", "22", "23", "24", "25", "26", "27", "28", "29", "30"}
    Private Days3 As String() = {"01", "02", "03", "04", "05", "06", "07",
"08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
"21", "22", "23", "24", "25", "26", "27", "28", "29"}
    Private Days4 As String() = {"01", "02", "03", "04", "05", "06", "07",
"08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20",
"21", "22", "23", "24", "25", "26", "27", "28"}
   Private Years As String() = {"2000", "2001", "2002", "2003", "2004",
"2005", "2006", "2007", "2008", "2009", "2010"}

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        If Not (Page.IsPostBack) Then
            Me.ddlMonth.DataSource = Months
            Me.ddlDay.DataSource = Days1
            Me.ddlYear.DataSource = Years
            Me.Page.DataBind()
        End If
    End Sub

    Private Sub ddlMonth_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ddlMonth.SelectedIndexChanged
        AdjustDay()
    End Sub

    Private Sub ddlYear_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles ddlYear.SelectedIndexChanged
        AdjustDay()
    End Sub

    Private Sub AdjustDay()
        Dim year As Int16
        Dim month As Int16
        year = Convert.ToInt16(Me.ddlYear.SelectedItem.ToString())
        month = Convert.ToInt16(Me.ddlMonth.SelectedItem.ToString())
        If month = 1 Or month = 3 Or month = 5 Or month = 7 Or month = 8 Or
month = 10 Or month = 12 Then
            Me.ddlDay.DataSource = Days1
        ElseIf month = 4 Or month = 6 Or month = 9 Or month = 11 Then
            Me.ddlDay.DataSource = Days2
        ElseIf month = 2 Then
            If year Mod 4 = 0 Then
                Me.ddlDay.DataSource = Days3
            Else
                Me.ddlDay.DataSource = Days4
            End If
        End If
        'Me.ddlDay.DataBind()
        Me.Page.DataBind()
    End Sub

#Region "Public Properties"

    Public ReadOnly Property Month() As Integer
        Get
            Dim val As String
            If ddlMonth.SelectedIndex.ToString() <> "" Then
                val = ddlMonth.SelectedItem.Value.ToString()
            Else
                val = DateTime.Now.Month.ToString()
            End If
            Return Convert.ToInt32(val)
        End Get
    End Property

    Public ReadOnly Property Day() As Integer
        Get
            Dim val As String
            If ddlDay.SelectedIndex.ToString() <> "" Then
                val = ddlDay.SelectedItem.Value.ToString()
            Else
                val = DateTime.Now.Day.ToString()
            End If
            Return Convert.ToInt32(val)
        End Get
    End Property

    Public ReadOnly Property Year() As Integer
        Get
            Dim val As String
            If ddlYear.SelectedIndex.ToString() <> "" Then
                val = ddlYear.SelectedItem.Value.ToString()
            Else
                val = DateTime.Now.Year.ToString()
            End If
            Return Convert.ToInt32(val)
        End Get
    End Property
#End Region
[/code]

den2005
--
MCP Year 2005, Philippines

Author
10 Mar 2006 5:50 AM
Munawar Hussain
Hi,
May I know, the exact scenario...
what I got is
1-You have apage, containing A dropDownList
2- A user control.

In in this scenarion  the indexchange event is not firing...

check the AutoPostBack property of dropdownlist.. IT should be true.

and in the Form Generated code .. the event handler should be registered.

this.DropDownList1.SelectedIndexChanged += new
System.EventHandler(this.DropDownList1_SelectedIndexChanged);

hopefuly, it would work

Regards
Munawar

Show quoteHide quote
"den 2005" <den2***@discussions.microsoft.com> wrote in message
news:5BA6F1D6-6723-469B-A634-680196824630@microsoft.com...
> Hi everybody,
>   I created a web user control and put this on a web application on same
> project. But the dropdownlist selectedindexchanged event is not working.
> That
> is first part of task, the next is to get the values of the dropdownlist
> of
> this user control to be used in web application. How could I fixed this
> problem? Thanks in advanced.
>
> User Control
> [code]
> Private Months As String() = {"01", "02", "03", "04", "05", "06", "07",
> "08", "09", "10", "11", "12"}
>    Private Days1 As String() = {"01", "02", "03", "04", "05", "06", "07",
> "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> "20",
> "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"}
>    Private Days2 As String() = {"01", "02", "03", "04", "05", "06", "07",
> "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> "20",
> "21", "22", "23", "24", "25", "26", "27", "28", "29", "30"}
>    Private Days3 As String() = {"01", "02", "03", "04", "05", "06", "07",
> "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> "20",
> "21", "22", "23", "24", "25", "26", "27", "28", "29"}
>    Private Days4 As String() = {"01", "02", "03", "04", "05", "06", "07",
> "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> "20",
> "21", "22", "23", "24", "25", "26", "27", "28"}
>   Private Years As String() = {"2000", "2001", "2002", "2003", "2004",
> "2005", "2006", "2007", "2008", "2009", "2010"}
>
> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>        'Put user code to initialize the page here
>        If Not (Page.IsPostBack) Then
>            Me.ddlMonth.DataSource = Months
>            Me.ddlDay.DataSource = Days1
>            Me.ddlYear.DataSource = Years
>            Me.Page.DataBind()
>        End If
>    End Sub
>
>    Private Sub ddlMonth_SelectedIndexChanged(ByVal sender As
> System.Object,
> ByVal e As System.EventArgs) Handles ddlMonth.SelectedIndexChanged
>        AdjustDay()
>    End Sub
>
>    Private Sub ddlYear_SelectedIndexChanged(ByVal sender As System.Object,
> ByVal e As System.EventArgs) Handles ddlYear.SelectedIndexChanged
>        AdjustDay()
>    End Sub
>
>    Private Sub AdjustDay()
>        Dim year As Int16
>        Dim month As Int16
>        year = Convert.ToInt16(Me.ddlYear.SelectedItem.ToString())
>        month = Convert.ToInt16(Me.ddlMonth.SelectedItem.ToString())
>        If month = 1 Or month = 3 Or month = 5 Or month = 7 Or month = 8 Or
> month = 10 Or month = 12 Then
>            Me.ddlDay.DataSource = Days1
>        ElseIf month = 4 Or month = 6 Or month = 9 Or month = 11 Then
>            Me.ddlDay.DataSource = Days2
>        ElseIf month = 2 Then
>            If year Mod 4 = 0 Then
>                Me.ddlDay.DataSource = Days3
>            Else
>                Me.ddlDay.DataSource = Days4
>            End If
>        End If
>        'Me.ddlDay.DataBind()
>        Me.Page.DataBind()
>    End Sub
>
> #Region "Public Properties"
>
>    Public ReadOnly Property Month() As Integer
>        Get
>            Dim val As String
>            If ddlMonth.SelectedIndex.ToString() <> "" Then
>                val = ddlMonth.SelectedItem.Value.ToString()
>            Else
>                val = DateTime.Now.Month.ToString()
>            End If
>            Return Convert.ToInt32(val)
>        End Get
>    End Property
>
>    Public ReadOnly Property Day() As Integer
>        Get
>            Dim val As String
>            If ddlDay.SelectedIndex.ToString() <> "" Then
>                val = ddlDay.SelectedItem.Value.ToString()
>            Else
>                val = DateTime.Now.Day.ToString()
>            End If
>            Return Convert.ToInt32(val)
>        End Get
>    End Property
>
>    Public ReadOnly Property Year() As Integer
>        Get
>            Dim val As String
>            If ddlYear.SelectedIndex.ToString() <> "" Then
>                val = ddlYear.SelectedItem.Value.ToString()
>            Else
>                val = DateTime.Now.Year.ToString()
>            End If
>            Return Convert.ToInt32(val)
>        End Get
>    End Property
> #End Region
> [/code]
>
> den2005
> --
> MCP Year 2005, Philippines
Author
13 Mar 2006 1:00 AM
den 2005
Thanks Munawar.

Setting Autopostback property to true works. Thanks. Why the Autopostback
property is not set to true by default? Do you what is the reason?

den2005

--
MCP Year 2005, Philippines


Show quoteHide quote
"Munawar Hussain" wrote:

> Hi,
> May I know, the exact scenario...
> what I got is
> 1-You have apage, containing A dropDownList
> 2- A user control.
>
> In in this scenarion  the indexchange event is not firing...
>
> check the AutoPostBack property of dropdownlist.. IT should be true.
>
> and in the Form Generated code .. the event handler should be registered.
>
> this.DropDownList1.SelectedIndexChanged += new
> System.EventHandler(this.DropDownList1_SelectedIndexChanged);
>
> hopefuly, it would work
>
> Regards
> Munawar
>
> "den 2005" <den2***@discussions.microsoft.com> wrote in message
> news:5BA6F1D6-6723-469B-A634-680196824630@microsoft.com...
> > Hi everybody,
> >   I created a web user control and put this on a web application on same
> > project. But the dropdownlist selectedindexchanged event is not working.
> > That
> > is first part of task, the next is to get the values of the dropdownlist
> > of
> > this user control to be used in web application. How could I fixed this
> > problem? Thanks in advanced.
> >
> > User Control
> > [code]
> > Private Months As String() = {"01", "02", "03", "04", "05", "06", "07",
> > "08", "09", "10", "11", "12"}
> >    Private Days1 As String() = {"01", "02", "03", "04", "05", "06", "07",
> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> > "20",
> > "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"}
> >    Private Days2 As String() = {"01", "02", "03", "04", "05", "06", "07",
> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> > "20",
> > "21", "22", "23", "24", "25", "26", "27", "28", "29", "30"}
> >    Private Days3 As String() = {"01", "02", "03", "04", "05", "06", "07",
> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> > "20",
> > "21", "22", "23", "24", "25", "26", "27", "28", "29"}
> >    Private Days4 As String() = {"01", "02", "03", "04", "05", "06", "07",
> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> > "20",
> > "21", "22", "23", "24", "25", "26", "27", "28"}
> >   Private Years As String() = {"2000", "2001", "2002", "2003", "2004",
> > "2005", "2006", "2007", "2008", "2009", "2010"}
> >
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> >        'Put user code to initialize the page here
> >        If Not (Page.IsPostBack) Then
> >            Me.ddlMonth.DataSource = Months
> >            Me.ddlDay.DataSource = Days1
> >            Me.ddlYear.DataSource = Years
> >            Me.Page.DataBind()
> >        End If
> >    End Sub
> >
> >    Private Sub ddlMonth_SelectedIndexChanged(ByVal sender As
> > System.Object,
> > ByVal e As System.EventArgs) Handles ddlMonth.SelectedIndexChanged
> >        AdjustDay()
> >    End Sub
> >
> >    Private Sub ddlYear_SelectedIndexChanged(ByVal sender As System.Object,
> > ByVal e As System.EventArgs) Handles ddlYear.SelectedIndexChanged
> >        AdjustDay()
> >    End Sub
> >
> >    Private Sub AdjustDay()
> >        Dim year As Int16
> >        Dim month As Int16
> >        year = Convert.ToInt16(Me.ddlYear.SelectedItem.ToString())
> >        month = Convert.ToInt16(Me.ddlMonth.SelectedItem.ToString())
> >        If month = 1 Or month = 3 Or month = 5 Or month = 7 Or month = 8 Or
> > month = 10 Or month = 12 Then
> >            Me.ddlDay.DataSource = Days1
> >        ElseIf month = 4 Or month = 6 Or month = 9 Or month = 11 Then
> >            Me.ddlDay.DataSource = Days2
> >        ElseIf month = 2 Then
> >            If year Mod 4 = 0 Then
> >                Me.ddlDay.DataSource = Days3
> >            Else
> >                Me.ddlDay.DataSource = Days4
> >            End If
> >        End If
> >        'Me.ddlDay.DataBind()
> >        Me.Page.DataBind()
> >    End Sub
> >
> > #Region "Public Properties"
> >
> >    Public ReadOnly Property Month() As Integer
> >        Get
> >            Dim val As String
> >            If ddlMonth.SelectedIndex.ToString() <> "" Then
> >                val = ddlMonth.SelectedItem.Value.ToString()
> >            Else
> >                val = DateTime.Now.Month.ToString()
> >            End If
> >            Return Convert.ToInt32(val)
> >        End Get
> >    End Property
> >
> >    Public ReadOnly Property Day() As Integer
> >        Get
> >            Dim val As String
> >            If ddlDay.SelectedIndex.ToString() <> "" Then
> >                val = ddlDay.SelectedItem.Value.ToString()
> >            Else
> >                val = DateTime.Now.Day.ToString()
> >            End If
> >            Return Convert.ToInt32(val)
> >        End Get
> >    End Property
> >
> >    Public ReadOnly Property Year() As Integer
> >        Get
> >            Dim val As String
> >            If ddlYear.SelectedIndex.ToString() <> "" Then
> >                val = ddlYear.SelectedItem.Value.ToString()
> >            Else
> >                val = DateTime.Now.Year.ToString()
> >            End If
> >            Return Convert.ToInt32(val)
> >        End Get
> >    End Property
> > #End Region
> > [/code]
> >
> > den2005
> > --
> > MCP Year 2005, Philippines
>
>
>
Author
13 Mar 2006 1:03 AM
den 2005
Hi Munawar,
  Forgot to ask. Do you know to perform debugging on a DLL when it is
reference ib a web application? Thanks in advanced.

den2005


--
MCP Year 2005, Philippines


Show quoteHide quote
"Munawar Hussain" wrote:

> Hi,
> May I know, the exact scenario...
> what I got is
> 1-You have apage, containing A dropDownList
> 2- A user control.
>
> In in this scenarion  the indexchange event is not firing...
>
> check the AutoPostBack property of dropdownlist.. IT should be true.
>
> and in the Form Generated code .. the event handler should be registered.
>
> this.DropDownList1.SelectedIndexChanged += new
> System.EventHandler(this.DropDownList1_SelectedIndexChanged);
>
> hopefuly, it would work
>
> Regards
> Munawar
>
> "den 2005" <den2***@discussions.microsoft.com> wrote in message
> news:5BA6F1D6-6723-469B-A634-680196824630@microsoft.com...
> > Hi everybody,
> >   I created a web user control and put this on a web application on same
> > project. But the dropdownlist selectedindexchanged event is not working.
> > That
> > is first part of task, the next is to get the values of the dropdownlist
> > of
> > this user control to be used in web application. How could I fixed this
> > problem? Thanks in advanced.
> >
> > User Control
> > [code]
> > Private Months As String() = {"01", "02", "03", "04", "05", "06", "07",
> > "08", "09", "10", "11", "12"}
> >    Private Days1 As String() = {"01", "02", "03", "04", "05", "06", "07",
> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> > "20",
> > "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"}
> >    Private Days2 As String() = {"01", "02", "03", "04", "05", "06", "07",
> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> > "20",
> > "21", "22", "23", "24", "25", "26", "27", "28", "29", "30"}
> >    Private Days3 As String() = {"01", "02", "03", "04", "05", "06", "07",
> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> > "20",
> > "21", "22", "23", "24", "25", "26", "27", "28", "29"}
> >    Private Days4 As String() = {"01", "02", "03", "04", "05", "06", "07",
> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> > "20",
> > "21", "22", "23", "24", "25", "26", "27", "28"}
> >   Private Years As String() = {"2000", "2001", "2002", "2003", "2004",
> > "2005", "2006", "2007", "2008", "2009", "2010"}
> >
> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> > System.EventArgs) Handles MyBase.Load
> >        'Put user code to initialize the page here
> >        If Not (Page.IsPostBack) Then
> >            Me.ddlMonth.DataSource = Months
> >            Me.ddlDay.DataSource = Days1
> >            Me.ddlYear.DataSource = Years
> >            Me.Page.DataBind()
> >        End If
> >    End Sub
> >
> >    Private Sub ddlMonth_SelectedIndexChanged(ByVal sender As
> > System.Object,
> > ByVal e As System.EventArgs) Handles ddlMonth.SelectedIndexChanged
> >        AdjustDay()
> >    End Sub
> >
> >    Private Sub ddlYear_SelectedIndexChanged(ByVal sender As System.Object,
> > ByVal e As System.EventArgs) Handles ddlYear.SelectedIndexChanged
> >        AdjustDay()
> >    End Sub
> >
> >    Private Sub AdjustDay()
> >        Dim year As Int16
> >        Dim month As Int16
> >        year = Convert.ToInt16(Me.ddlYear.SelectedItem.ToString())
> >        month = Convert.ToInt16(Me.ddlMonth.SelectedItem.ToString())
> >        If month = 1 Or month = 3 Or month = 5 Or month = 7 Or month = 8 Or
> > month = 10 Or month = 12 Then
> >            Me.ddlDay.DataSource = Days1
> >        ElseIf month = 4 Or month = 6 Or month = 9 Or month = 11 Then
> >            Me.ddlDay.DataSource = Days2
> >        ElseIf month = 2 Then
> >            If year Mod 4 = 0 Then
> >                Me.ddlDay.DataSource = Days3
> >            Else
> >                Me.ddlDay.DataSource = Days4
> >            End If
> >        End If
> >        'Me.ddlDay.DataBind()
> >        Me.Page.DataBind()
> >    End Sub
> >
> > #Region "Public Properties"
> >
> >    Public ReadOnly Property Month() As Integer
> >        Get
> >            Dim val As String
> >            If ddlMonth.SelectedIndex.ToString() <> "" Then
> >                val = ddlMonth.SelectedItem.Value.ToString()
> >            Else
> >                val = DateTime.Now.Month.ToString()
> >            End If
> >            Return Convert.ToInt32(val)
> >        End Get
> >    End Property
> >
> >    Public ReadOnly Property Day() As Integer
> >        Get
> >            Dim val As String
> >            If ddlDay.SelectedIndex.ToString() <> "" Then
> >                val = ddlDay.SelectedItem.Value.ToString()
> >            Else
> >                val = DateTime.Now.Day.ToString()
> >            End If
> >            Return Convert.ToInt32(val)
> >        End Get
> >    End Property
> >
> >    Public ReadOnly Property Year() As Integer
> >        Get
> >            Dim val As String
> >            If ddlYear.SelectedIndex.ToString() <> "" Then
> >                val = ddlYear.SelectedItem.Value.ToString()
> >            Else
> >                val = DateTime.Now.Year.ToString()
> >            End If
> >            Return Convert.ToInt32(val)
> >        End Get
> >    End Property
> > #End Region
> > [/code]
> >
> > den2005
> > --
> > MCP Year 2005, Philippines
>
>
>
Author
13 Mar 2006 10:55 AM
Munawar Hussain
Hi,

First thing about why AutoPostBack is not true by default.
Because everywhere its not required to postback every control.... I think
so.

Debuggin a Library .dll

If its your own library , then its obvious you can debug it...
To do that you need to open that library in visual studio .. in save
solution or seprat...


Show quoteHide quote
"den 2005" <den2***@discussions.microsoft.com> wrote in message
news:75294D4F-41E7-4654-A6C9-34CF988FC984@microsoft.com...
> Hi Munawar,
>  Forgot to ask. Do you know to perform debugging on a DLL when it is
> reference ib a web application? Thanks in advanced.
>
> den2005
>
>
> --
> MCP Year 2005, Philippines
>
>
> "Munawar Hussain" wrote:
>
>> Hi,
>> May I know, the exact scenario...
>> what I got is
>> 1-You have apage, containing A dropDownList
>> 2- A user control.
>>
>> In in this scenarion  the indexchange event is not firing...
>>
>> check the AutoPostBack property of dropdownlist.. IT should be true.
>>
>> and in the Form Generated code .. the event handler should be registered.
>>
>> this.DropDownList1.SelectedIndexChanged += new
>> System.EventHandler(this.DropDownList1_SelectedIndexChanged);
>>
>> hopefuly, it would work
>>
>> Regards
>> Munawar
>>
>> "den 2005" <den2***@discussions.microsoft.com> wrote in message
>> news:5BA6F1D6-6723-469B-A634-680196824630@microsoft.com...
>> > Hi everybody,
>> >   I created a web user control and put this on a web application on
>> > same
>> > project. But the dropdownlist selectedindexchanged event is not
>> > working.
>> > That
>> > is first part of task, the next is to get the values of the
>> > dropdownlist
>> > of
>> > this user control to be used in web application. How could I fixed this
>> > problem? Thanks in advanced.
>> >
>> > User Control
>> > [code]
>> > Private Months As String() = {"01", "02", "03", "04", "05", "06", "07",
>> > "08", "09", "10", "11", "12"}
>> >    Private Days1 As String() = {"01", "02", "03", "04", "05", "06",
>> > "07",
>> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
>> > "20",
>> > "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"}
>> >    Private Days2 As String() = {"01", "02", "03", "04", "05", "06",
>> > "07",
>> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
>> > "20",
>> > "21", "22", "23", "24", "25", "26", "27", "28", "29", "30"}
>> >    Private Days3 As String() = {"01", "02", "03", "04", "05", "06",
>> > "07",
>> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
>> > "20",
>> > "21", "22", "23", "24", "25", "26", "27", "28", "29"}
>> >    Private Days4 As String() = {"01", "02", "03", "04", "05", "06",
>> > "07",
>> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
>> > "20",
>> > "21", "22", "23", "24", "25", "26", "27", "28"}
>> >   Private Years As String() = {"2000", "2001", "2002", "2003", "2004",
>> > "2005", "2006", "2007", "2008", "2009", "2010"}
>> >
>> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
>> > System.EventArgs) Handles MyBase.Load
>> >        'Put user code to initialize the page here
>> >        If Not (Page.IsPostBack) Then
>> >            Me.ddlMonth.DataSource = Months
>> >            Me.ddlDay.DataSource = Days1
>> >            Me.ddlYear.DataSource = Years
>> >            Me.Page.DataBind()
>> >        End If
>> >    End Sub
>> >
>> >    Private Sub ddlMonth_SelectedIndexChanged(ByVal sender As
>> > System.Object,
>> > ByVal e As System.EventArgs) Handles ddlMonth.SelectedIndexChanged
>> >        AdjustDay()
>> >    End Sub
>> >
>> >    Private Sub ddlYear_SelectedIndexChanged(ByVal sender As
>> > System.Object,
>> > ByVal e As System.EventArgs) Handles ddlYear.SelectedIndexChanged
>> >        AdjustDay()
>> >    End Sub
>> >
>> >    Private Sub AdjustDay()
>> >        Dim year As Int16
>> >        Dim month As Int16
>> >        year = Convert.ToInt16(Me.ddlYear.SelectedItem.ToString())
>> >        month = Convert.ToInt16(Me.ddlMonth.SelectedItem.ToString())
>> >        If month = 1 Or month = 3 Or month = 5 Or month = 7 Or month = 8
>> > Or
>> > month = 10 Or month = 12 Then
>> >            Me.ddlDay.DataSource = Days1
>> >        ElseIf month = 4 Or month = 6 Or month = 9 Or month = 11 Then
>> >            Me.ddlDay.DataSource = Days2
>> >        ElseIf month = 2 Then
>> >            If year Mod 4 = 0 Then
>> >                Me.ddlDay.DataSource = Days3
>> >            Else
>> >                Me.ddlDay.DataSource = Days4
>> >            End If
>> >        End If
>> >        'Me.ddlDay.DataBind()
>> >        Me.Page.DataBind()
>> >    End Sub
>> >
>> > #Region "Public Properties"
>> >
>> >    Public ReadOnly Property Month() As Integer
>> >        Get
>> >            Dim val As String
>> >            If ddlMonth.SelectedIndex.ToString() <> "" Then
>> >                val = ddlMonth.SelectedItem.Value.ToString()
>> >            Else
>> >                val = DateTime.Now.Month.ToString()
>> >            End If
>> >            Return Convert.ToInt32(val)
>> >        End Get
>> >    End Property
>> >
>> >    Public ReadOnly Property Day() As Integer
>> >        Get
>> >            Dim val As String
>> >            If ddlDay.SelectedIndex.ToString() <> "" Then
>> >                val = ddlDay.SelectedItem.Value.ToString()
>> >            Else
>> >                val = DateTime.Now.Day.ToString()
>> >            End If
>> >            Return Convert.ToInt32(val)
>> >        End Get
>> >    End Property
>> >
>> >    Public ReadOnly Property Year() As Integer
>> >        Get
>> >            Dim val As String
>> >            If ddlYear.SelectedIndex.ToString() <> "" Then
>> >                val = ddlYear.SelectedItem.Value.ToString()
>> >            Else
>> >                val = DateTime.Now.Year.ToString()
>> >            End If
>> >            Return Convert.ToInt32(val)
>> >        End Get
>> >    End Property
>> > #End Region
>> > [/code]
>> >
>> > den2005
>> > --
>> > MCP Year 2005, Philippines
>>
>>
>>
Author
14 Mar 2006 6:47 AM
den 2005
Hi Munawar,

[quote]
Debuggin a Library .dll

If its your own library , then its obvious you can debug it...
To do that you need to open that library in visual studio .. in save
solution or seprat...
[\quote]

    Open the source code and then set a breakpoint on which statement I want
to start the debugging..Is that right?
If I do not have the code, is that still possible?

den2005

--
MCP Year 2005, Philippines


Show quoteHide quote
"Munawar Hussain" wrote:

> Hi,
>
> First thing about why AutoPostBack is not true by default.
> Because everywhere its not required to postback every control.... I think
> so.
>
> Debuggin a Library .dll
>
> If its your own library , then its obvious you can debug it...
> To do that you need to open that library in visual studio .. in save
> solution or seprat...
>
>
> "den 2005" <den2***@discussions.microsoft.com> wrote in message
> news:75294D4F-41E7-4654-A6C9-34CF988FC984@microsoft.com...
> > Hi Munawar,
> >  Forgot to ask. Do you know to perform debugging on a DLL when it is
> > reference ib a web application? Thanks in advanced.
> >
> > den2005
> >
> >
> > --
> > MCP Year 2005, Philippines
> >
> >
> > "Munawar Hussain" wrote:
> >
> >> Hi,
> >> May I know, the exact scenario...
> >> what I got is
> >> 1-You have apage, containing A dropDownList
> >> 2- A user control.
> >>
> >> In in this scenarion  the indexchange event is not firing...
> >>
> >> check the AutoPostBack property of dropdownlist.. IT should be true.
> >>
> >> and in the Form Generated code .. the event handler should be registered.
> >>
> >> this.DropDownList1.SelectedIndexChanged += new
> >> System.EventHandler(this.DropDownList1_SelectedIndexChanged);
> >>
> >> hopefuly, it would work
> >>
> >> Regards
> >> Munawar
> >>
> >> "den 2005" <den2***@discussions.microsoft.com> wrote in message
> >> news:5BA6F1D6-6723-469B-A634-680196824630@microsoft.com...
> >> > Hi everybody,
> >> >   I created a web user control and put this on a web application on
> >> > same
> >> > project. But the dropdownlist selectedindexchanged event is not
> >> > working.
> >> > That
> >> > is first part of task, the next is to get the values of the
> >> > dropdownlist
> >> > of
> >> > this user control to be used in web application. How could I fixed this
> >> > problem? Thanks in advanced.
> >> >
> >> > User Control
> >> > [code]
> >> > Private Months As String() = {"01", "02", "03", "04", "05", "06", "07",
> >> > "08", "09", "10", "11", "12"}
> >> >    Private Days1 As String() = {"01", "02", "03", "04", "05", "06",
> >> > "07",
> >> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> >> > "20",
> >> > "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"}
> >> >    Private Days2 As String() = {"01", "02", "03", "04", "05", "06",
> >> > "07",
> >> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> >> > "20",
> >> > "21", "22", "23", "24", "25", "26", "27", "28", "29", "30"}
> >> >    Private Days3 As String() = {"01", "02", "03", "04", "05", "06",
> >> > "07",
> >> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> >> > "20",
> >> > "21", "22", "23", "24", "25", "26", "27", "28", "29"}
> >> >    Private Days4 As String() = {"01", "02", "03", "04", "05", "06",
> >> > "07",
> >> > "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19",
> >> > "20",
> >> > "21", "22", "23", "24", "25", "26", "27", "28"}
> >> >   Private Years As String() = {"2000", "2001", "2002", "2003", "2004",
> >> > "2005", "2006", "2007", "2008", "2009", "2010"}
> >> >
> >> > Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
> >> > System.EventArgs) Handles MyBase.Load
> >> >        'Put user code to initialize the page here
> >> >        If Not (Page.IsPostBack) Then
> >> >            Me.ddlMonth.DataSource = Months
> >> >            Me.ddlDay.DataSource = Days1
> >> >            Me.ddlYear.DataSource = Years
> >> >            Me.Page.DataBind()
> >> >        End If
> >> >    End Sub
> >> >
> >> >    Private Sub ddlMonth_SelectedIndexChanged(ByVal sender As
> >> > System.Object,
> >> > ByVal e As System.EventArgs) Handles ddlMonth.SelectedIndexChanged
> >> >        AdjustDay()
> >> >    End Sub
> >> >
> >> >    Private Sub ddlYear_SelectedIndexChanged(ByVal sender As
> >> > System.Object,
> >> > ByVal e As System.EventArgs) Handles ddlYear.SelectedIndexChanged
> >> >        AdjustDay()
> >> >    End Sub
> >> >
> >> >    Private Sub AdjustDay()
> >> >        Dim year As Int16
> >> >        Dim month As Int16
> >> >        year = Convert.ToInt16(Me.ddlYear.SelectedItem.ToString())
> >> >        month = Convert.ToInt16(Me.ddlMonth.SelectedItem.ToString())
> >> >        If month = 1 Or month = 3 Or month = 5 Or month = 7 Or month = 8
> >> > Or
> >> > month = 10 Or month = 12 Then
> >> >            Me.ddlDay.DataSource = Days1
> >> >        ElseIf month = 4 Or month = 6 Or month = 9 Or month = 11 Then
> >> >            Me.ddlDay.DataSource = Days2
> >> >        ElseIf month = 2 Then
> >> >            If year Mod 4 = 0 Then
> >> >                Me.ddlDay.DataSource = Days3
> >> >            Else
> >> >                Me.ddlDay.DataSource = Days4
> >> >            End If
> >> >        End If
> >> >        'Me.ddlDay.DataBind()
> >> >        Me.Page.DataBind()
> >> >    End Sub
> >> >
> >> > #Region "Public Properties"
> >> >
> >> >    Public ReadOnly Property Month() As Integer
> >> >        Get
> >> >            Dim val As String
> >> >            If ddlMonth.SelectedIndex.ToString() <> "" Then
> >> >                val = ddlMonth.SelectedItem.Value.ToString()
> >> >            Else
> >> >                val = DateTime.Now.Month.ToString()
> >> >            End If
> >> >            Return Convert.ToInt32(val)
> >> >        End Get
> >> >    End Property
> >> >
> >> >    Public ReadOnly Property Day() As Integer
> >> >        Get
> >> >            Dim val As String
> >> >            If ddlDay.SelectedIndex.ToString() <> "" Then
> >> >                val = ddlDay.SelectedItem.Value.ToString()
> >> >            Else
> >> >                val = DateTime.Now.Day.ToString()
> >> >            End If
> >> >            Return Convert.ToInt32(val)
> >> >        End Get
> >> >    End Property
> >> >
> >> >    Public ReadOnly Property Year() As Integer
> >> >        Get
> >> >            Dim val As String
> >> >            If ddlYear.SelectedIndex.ToString() <> "" Then
> >> >                val = ddlYear.SelectedItem.Value.ToString()
> >> >            Else
> >> >                val = DateTime.Now.Year.ToString()
> >> >            End If
> >> >            Return Convert.ToInt32(val)
> >> >        End Get
> >> >    End Property
> >> > #End Region
> >> > [/code]
> >> >
> >> > den2005
> >> > --
> >> > MCP Year 2005, Philippines
> >>
> >>
> >>
>
>
>