Solved

Fetch data from database and display in modalpopup .NET 2.0

Posted on 2009-07-04
9
475 Views
Last Modified: 2013-12-05
Hi All,
I am using modalpopupextender. i am fetching the data and want to display in modalpopup when ever user selects and clicks one button.

I can able to fetch the data and assign to lables placed in a panel which shall popup. I am assigning the data to labels, but cant see the data.
No error or exception i am getting. Please suggest the rigth approch to solve this issue.
0
Comment
Question by:sudhir_gs1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
9 Comments
 
LVL 7

Expert Comment

by:meispisces
ID: 24776597
How are you assigning the data to the labels?

please post the HTML code of modal popup. I want to have a look into that....and then could i solve your problem correctly

thanks

0
 

Author Comment

by:sudhir_gs1
ID: 24776639
I am assigning data to labels in code behind
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <table bgcolor="#580coc"style="width: 375px" cellpadding="0" cellspacing="0">
                            <tr>
                                <td style="width: 97px; height: 28px; color: white;">Sales Executive
                                </td>
                                    <td><asp:DropDownList ID="DropDownList1" runat="server" Width="104px" AutoPostBack="True" OnSelect="drawboundry('we')" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" >
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr align="center"> <td colspan=2 style="color: white;">Coolers</td></tr>
                            <tr align="center">
                                <td colspan=2>
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                             
                                    <asp:ListBox ID="lstcooler" runat="server" Width="136px"></asp:ListBox>
                                </td>
                               
                            </tr>
                            <tr align ="center" >
                                <td colspan=2 style="height: 31px" align="left">
                                    &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;<input id="Button1" type="button" onclick="getcooler('str');getBoundries('I');"
                                        value="Load" style="width: 104px" />
                                        <asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>
                                    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<asp:Button ID="btnshowinfo" runat="server" Text="Show Information"
                                        Width="128px" /><br />
                                    <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender2" runat="server" BackgroundCssClass="modalBackground"
                                       DropShadow="true" OkControlID="btnOk" OnOkScript=""
                                       PopupControlID="Panel2" PopupDragHandleControlID="Panel4" TargetControlID="TextBox1">
                                    </ajaxToolkit:ModalPopupExtender>
                                </td>
                                
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
 
----------vb code--------
 
Protected Sub btnshowinfo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnshowinfo.Click
        Dim sql As StringBuilder = New StringBuilder()
 
        sql.Append("SELECT ITEM_NAME,ASSET_TAG,ADDRESS,PHONE_NO,GCC_CODE,LAST_SERVICE_DATE,NEXT_SERVICE_DATE,AVG_SALES,NO_COMPLAINTS")
        sql.Append(" FROM COOLERDETAILS")
        sql.Append(" WHERE OUTLET_NAME='" & lstcooler.SelectedItem.Text & "'")
        Dim row As DataRow = Db.GetDataRow(sql.ToString())
 
        lblItemName.Text = row("Item_name").ToString()
        lblAssetTag.Text = row("Asset_tag").ToString()
        lblAddress.Text = row("Address").ToString()
        lblPhoneNo.Text = row("Phone_No").ToString()
        lblGccCode.Text = row("GCC_code").ToString()
        lblLastService.Text = row("Last_service_date").ToString()
        lblNextService.Text = row("Next_Service_Date").ToString()
        lblAverageSales.Text = row("Avg_Sales").ToString()
        lblNoOfComplanints.Text = row("No_Complaints").ToString()
 
        ModalPopupExtender2.Show()
    End Sub

Open in new window

0
 
LVL 7

Expert Comment

by:meispisces
ID: 24776723
Modify your code as

Modal popup Opening Tag

Update Pane Opening Tag

Content Template Opening Tag

Your Design Code  (Table, tr, td etc)


 Content Template Closing Tag

Update Panel Closing Tag

Modal popup Closing Tag
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:sudhir_gs1
ID: 24782847
Hi, Thanks for help, You mean Modal popup  extender tag  panel tag?

Can you please modify my code and repost
0
 
LVL 7

Accepted Solution

by:
meispisces earned 125 total points
ID: 24784498
<ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender2" runat="server" BackgroundCssClass="modalBackground"
                                       DropShadow="true" OkControlID="btnOk" OnOkScript=""
                                       PopupControlID="pnlExample " PopupDragHandleControlID="Panel4" TargetControlID="btnExample" >

<asp:Button id="btnExample" runat="Server" style="display:none"><asp:panel id ="pnlExample runat="server"  style="display:none">

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <table bgcolor="#580coc"style="width: 375px" cellpadding="0" cellspacing="0">
                            <tr>
                                <td style="width: 97px; height: 28px; color: white;">Sales Executive
                                </td>
                                    <td><asp:DropDownList ID="DropDownList1" runat="server" Width="104px" AutoPostBack="True" OnSelect="drawboundry('we')" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" >
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr align="center"> <td colspan=2 style="color: white;">Coolers</td></tr>
                            <tr align="center">
                                <td colspan=2>
                                               
                                             
                             
                                    <asp:ListBox ID="lstcooler" runat="server" Width="136px"></asp:ListBox>
                                </td>
                               
                            </tr>
                            <tr align ="center" >
                                <td colspan=2 style="height: 31px" align="left">
                                              <input id="Button1" type="button" onclick="getcooler('str');getBoundries('I');"
                                        value="Load" style="width: 104px" />
                                        <asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>
                                             <asp:Button ID="btnshowinfo" runat="server" Text="Show Information"
                                        Width="128px" /><br />

</td>
                               
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>

</ajaxToolkit:ModalPopupExtender>


Changes are marked in Bold

thanks!!!


0
 
LVL 7

Expert Comment

by:meispisces
ID: 24784523
Ooopsss.. i forgot to add the closing tag of Panel,

it would be after updatePanel....like </asp:panel>

Also there would not be anything like  </ajaxToolkit:ModalPopupExtender>

the Modal poup extender has closing tag like

<asp:modalpopupextender id="mpe1" ..........  .....     ......   drag="true" / >


thanks
0
 
LVL 7

Expert Comment

by:meispisces
ID: 24791397
Hey sudhir, is your problem solved?
0
 

Author Comment

by:sudhir_gs1
ID: 24802030
Thanks for your help. It solved my problem

Sudhir
0
 
LVL 7

Expert Comment

by:meispisces
ID: 24802058
thanks for accepting..and too very soon...!!!


0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question