Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
sir, i have a modern popup. In which i have a checkboxlist and a Button. i need to send selected checkboxlist value on vb page. how can i do it.. my code id like:-

XML
<script type="text/javascript">
$(function() {
$('#<%=Button1.ClientID%>').click(function() {
$("#popupdiv").dialog({
width: 400,
height: 250,
modal: true
});
return false;
});
})

  function loadStudent()

{
   __doPostBack('load$student');
}
</script>



XML
<asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="SqlDataSource2" DataTextField="code" DataValueField="departmentid"
                     RepeatColumns="2"  RepeatDirection="Horizontal">
  </asp:CheckBoxList>
Posted

1 solution

I can give you an example with c#
First Create Default.aspx and paste code
ASP.NET
<![CDATA[<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="atk" %>
<asp:content id="Content1" contentplaceholderid="HeadContent" runat="Server" xmlns:asp="#unknown">
<style type="text/css">
       
                .modalBackground
                {
                       background-color: Gray;
                        filter: alpha(opacity=80);
                        opacity: 0.8;
                        z-index: 10000;
                }
    
    </style>
</asp:content>
<asp:content id="Content2" contentplaceholderid="MainContent" runat="Server" xmlns:asp="#unknown"> 
<hr />
    <asp:label id="lbltotalRow" runat="server" text=""></asp:label>
<asp:panel id="Panel1" runat="server" height="310px" scrollbars="Vertical">

    <asp:gridview id="grdviewFileList" runat="server">
         Width="890px"  >
      <columns>  
         
            <asp:templatefield>
                <itemtemplate>
 <asp:linkbutton id="lnkView" text="Download" runat="server" onclick="DownloadFile"></asp:linkbutton>
                </itemtemplate>
            </asp:templatefield>                     

            </columns>
        
    </asp:gridview>
</asp:panel></asp:content>



  /////////////////////////// Start /////////////////////  PopupView Panel  ///////////////////////////////// /////////////////////  
          <asp:button id="btnShowPopup" runat="server" style="display:none" xmlns:asp="#unknown" />
         
        <atk:modalpopupextender id="ModalPopupExtender1"  runat="server" targetcontrolid="btnShowPopup" popupcontrolid="PopupView" xmlns:atk="#unknown">
            CancelControlID="btnCancel" BackgroundCssClass="modalBackground">
        </atk:modalpopupextender>


Default.cs
C#
String ConnectionString = ConfigurationManager.ConnectionStrings["YourConnectionStringsname"].ConnectionString;
   protected void Page_Load(object sender, EventArgs e)
   {
       if (!Page.IsPostBack)
       {
           DatabindFileList();
           
       }

   }

 public void DatabindFileList()
    {
       
        try
        {
            SqlConnection con = new SqlConnection(ConnectionString);
            SqlCommand cmd = new SqlCommand("SP_DataBindFileList", con);
            cmd.CommandType = CommandType.StoredProcedure;
           // cmd.Parameters.AddWithValue("@Sub_categoryID", sub_categoryname);
            con.Open();
            grdviewFileList.EmptyDataText = "No Records Found";
            grdviewFileList.DataSource = cmd.ExecuteReader();
            grdviewFileList.DataBind();

            lbltotalRow.Text = "Total : " + Convert.ToString(grdviewFileList.Rows.Count) + " Records found" + "<br />";
        }
        catch  
        {
             
        }
    }
 protected void DownloadFile(object sender, EventArgs e)
  {
      string filePath = (sender as LinkButton).CommandArgument;    
     iframe.Attributes.Add("src", filePath);
     this.ModalPopupExtender1.Show();
  } 

if you are work with VB.net Please Convert C# to VB
 
Share this answer
 
v3

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900