Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

how to hide panel in modal popup extender if no record found

$
0
0

I am using modal popup extender where I want to hide pop up if there is no record.how to do that??

I tried  java script function

('ScriptManager.RegisterClientScriptBlock(Me, Me.[GetType](), "DeleteRedirect", "<script>hidediv();</script>", False)

,but that is not working in .I am using VB.Net.please help

<asp:GridView CssClass="forgrid" ID="GridView1" runat="server" AutoGenerateColumns="False" BorderColor="#336699"
BorderStyle="Solid" BorderWidth="1px" CellPadding="3" Font-Names="Verdana" Font-Size="10pt"
OnRowCreated="GridView1_RowCreated">
<Columns>
<asp:BoundField DataField="billId" HeaderText="Bill No" />
<asp:BoundField DataField="billAmount" HeaderText="Bill Amount" />
<asp:BoundField DataField="onDate" HeaderText="Date" />
<%--<asp:TemplateField ItemStyle-Width="40" ItemStyle-HorizontalAlign="Right"></asp:TemplateField> --%>
<asp:TemplateField ItemStyle-Width="40" HeaderText="Details" ItemStyle-HorizontalAlign="Right">
<ItemTemplate >
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/magnify.gif" />
<ajax:popupcontrolextender id="PopupControlExtender1" runat="server" popupcontrolid="Panel1"
targetcontrolid="Image1" dynamiccontextkey='<%# Eval("billId") %>' dynamiccontrolid="Panel1"
dynamicservicemethod="GetDynamicContent" OffsetY ="-200" OffsetX="-530" position="Top" >
</ajax:popupcontrolextender>
</ItemTemplate>
</asp:TemplateField>

</Columns>
<HeaderStyle BackColor="#336699" ForeColor="White" />
</asp:GridView>
</td> </tr>
</table>
<asp:Panel ID="Panel1" CssClass="panel11" BorderColor="#336699" BorderStyle="Solid" BorderWidth="3px" Height="300" ScrollBars="Vertical" runat="server" >
</asp:Panel>
</div>

<System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()> _
Public Shared Function GetDynamicContent(ByVal contextKey As String) As String
Dim pn As New Panel
Dim obj1 As New clsdatabase
Dim st As String = "select product_category.category,"
st += "product.heading,product_sale_detail.price,product_sale_detail.quantity"
st += " "
st += "from product_sale_detail,product_category,product "
st += "where product.proId = product_sale_detail.proId "
st += "and product.catId = product_category.catId"
st += " "
st += "and product_sale_detail.billId =" & contextKey
Dim query As String = "SELECT billId,quantity,price FROM product_sale_detail WHERE billId = " + contextKey
Dim table As New DataTable()
table = obj1.getDataTable(st)
Dim b As New StringBuilder()
Dim i As Integer
i = 0
If table.Rows.Count > 0 Then

b.Append("<table style='background-color:#f3f3f3; border: #336699 0px solid; ")
b.Append("width:600px; font-size:10pt; font-family:Verdana;' cellspacing='0' cellpadding='4'>")
b.Append("<tr><td colspan='3' style=' background-color:#336699; color:white;'>")
b.Append("<b>Details</b></td>")
b.Append("<td style=' background-color:#336699; color:white; align:right'><a onclick='hidediv();' style='cursor: pointer;'>Close</a>")
b.Append("</td></tr>")
b.Append("<tr><td style='width:100px;'><b>Category</b></td>")
b.Append("<td style='width:200px;'><b>Product Name</b></td>")
b.Append("<td style='width:100px;'><b>Quantity</b></td>")
b.Append("<td style='width:100px;'><b>Amount</b></td></tr>")
For Each row As DataRow In table.Rows
b.Append("<tr>")
b.Append("<td style='width:100px;' >" + table.Rows(i)("category").ToString() + "</td>")
b.Append("<td style='width:200px;'>" + table.Rows(i)("heading").ToString() + "</td>")
b.Append("<td style='width:100px;'>" + table.Rows(i)("quantity").ToString() + "</td>")
b.Append("<td style='width:100px;' >" + table.Rows(i)("price").ToString() + "</td>")
b.Append("</tr>")
i = i + 1
Next
b.Append("</table>")
Else
??????????????????????????????????????

End If

Return b.ToString()


End Function


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>