Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET Ajax VB.NET
i have modalpopup by using ajax
in modalpopup i have one dropdownlist. i click button modalpopup is open.
i select dropdownlist option, event does not fired and page is refresh . again i click the option after that dropdown event fired.
Posted 2-Dec-12 21:09pm
Er. Vikas Sangal at 3-Dec-12 5:16am
pls. post ur code
kumar2233 at 3-Dec-12 5:34am
<cc:modalpopupextender id="ModalPopupExtender1" runat="server" BackgroundCssClass="modalBackground"
targetcontrolid="btnSubject" popupcontrolid="Panel1" drag="true" CancelControlID="lnkClose" >

Protected Sub btnSubject_Click(sender As Object, e As System.EventArgs) Handles btnSubject.Click
ModalPopupExtender1.Enabled = True
Catch ex As Exception
booError = True
Dim ErrContext As HttpContext = HttpContext.Current
ErrContext.Items.Add("ErrDesc", ex.Message)
ErrContext.Items.Add("ErrSrc", ex.Source)
ErrContext.Items.Add("ErrInfo", ex.StackTrace)
ErrContext.Items.Add("ErrFile", "D")
'If Not ddlIHNO Is Nothing Then ddlIHNO.Dispose()
'ddlIHNO = Nothing
'If Not ds Is Nothing Then ds.Dispose()
'ds = Nothing
End Try
If booError Then Response.Redirect("ErrorMessage.aspx", False)

End Sub

Protected Sub ddlDesc_SelectedIndexChanged(sender As Object, e As System.EventArgs) Handles ddldesc.SelectedIndexChanged

ModalPopupExtender1.Enabled = True
Dim objDetails As New Service
Dim dsdesc As New DataSet
dsdesc = objDetails.TaskMF_NCT_getSubjects(strApplid, strApplpwd, ddldesc.SelectedValue)
ddlSubject.DataTextField = "nm_description"
ddlSubject.DataValueField = "nm_code"
ddlSubject.DataSource = dsdesc.Tables(1)
Dim ds As New DataSet
If Not Session("dsimage") Is Nothing Then
ds = DirectCast(Session("dsimage"), DataSet)
End If
Dim lblnctcode1 As New Label
lblnctcode1.Text = "Nct Code" + "   " + ":"
lblnctcode1.Attributes.Add("class", "lbl")
Dim lblnctcode As New Label
Session("Nct") = ds.Tables(1).Rows(0).Item("NTCODE").ToString()
lblnctcode.Text = ds.Tables(1).Rows(0).Item("NTCODE").ToString() + "   "
lblnctcode.Attributes.Add("class", "lbl1")
Dim Lbldesc1 As New Label
Lbldesc1.Text = "Description" + "   " + ":"
Lbldesc1.Attributes.Add("class", "lbl")

Dim Lbldesc As New Label
Lbldesc.Text = ds.Tables(1).Rows(0).Item("SUBJECT").ToString() + "   "
Lbldesc.Attributes.Add("class", "lbl1")

Dim LblINVST As New Label
LblINVST.Text = "Investor Name " + "   " + ":"
LblINVST.Attributes.Add("class", "lbl")

Dim LblINVST1 As New Label
LblINVST1.Text = ds.Tables(1).Rows(0).Item("INVNAME").ToString() + "   "
LblINVST1.Attributes.Add("class", "lbl1")
Dim LblFLAGDESC As New Label
LblFLAGDESC.Text = "Flag Description " + "   "
LblFLAGDESC.Attributes.Add("class", "lbl")
Dim LblFLAGDESC1 As New Label
LblFLAGDESC1.Text = ds.Tables(1).Rows(0).Item("FLAGDESC").ToString() + "   "
LblFLAGDESC1.Attributes.Add("class", "lbl1")
Dim LblFolioNo As New Label
LblFolioNo.Text = "Folio No " + "   " + ":"
LblFolioNo.Attributes.Add("class", "lbl")
Dim LblFolioNo1 As New Label
LblFolioNo1.Text = ds.Tables(1).Rows(0).Item("FOLIONUM").ToString()
LblFolioNo1.Attributes.Add("class", "lbl1")

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Put your model pop in Update panel and use Trigger for the drop down selected index change event. will solve your problem,


<asp:ScriptManager ID="ScriptManager1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel2" runat="server" CssClass="pnlAlign">
 <asp:Button runat="server" ID="btnShowModalPopup" Style="display: none" />
                    <ajax:ModalPopupExtender ID="mpopRejectAndRework" runat="server" TargetControlID="btnShowModalPopup"
                        PopupControlID="divPopUp" BackgroundCssClass="modalBackground" DropShadow="true"
                        RepositionMode="RepositionOnWindowResize" />
 <asp:DropDownList ID="ddlStatus" runat="server" Width="200px" AutoPostBack="True" CssClass="input"
            <asp:PostBackTrigger ControlID="ddlStatus" />

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 105
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310

Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 4 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100