Dear Friends,
am using UserControl(.ascx) 6 Times in a single page(.aspx)
my problem is: in usercontrol have dropdownlist
how to get 6 dropdowns selected value
am binding dynamically(DB) from dropdown values
i wrote like:
$(document).ready(function(){
$('#ddlCountry').change(function () {
$('#hidCuntry1').val($("select[name='#ctl00$ContentPlaceHolder1$using1$ddlCountry']").val());
$('#hidCuntry11').val($("select[name='#ctl00$ContentPlaceHolder1$using2$ddlCountry']").val());
$('#hidCuntry111').val($("select[name='#ctl00$ContentPlaceHolder1$using3$ddlCountry']").val());
$('#hidCuntry1111').val($("select[name='#ctl00$ContentPlaceHolder1$using4$ddlCountry']").val());
$('#hidCuntry11111').val($("select[name='#ctl00$ContentPlaceHolder1$using5$ddlCountry']").val());
$('#hidCuntry111111').val($("select[name='#ctl00$ContentPlaceHolder1$using6$ddlCountry']").val());
});
});
if U Known Pls Help Me
Loading
Vikram AgrawalPosted Nov 10, 2014, 4:54 AM
see for every problem there is various solutions
so here is one way to solve your problem
.aspx :
<script type="text/javascript">
function disp(id) {
var txt = document.getElementById('txtResult');
txt.value = id.value;
}
script>
<div>
<asp:TextBox ID="txtResult" runat="server">asp:TextBox>
<table>
<tr>
<td>
<UC:UcDdl ID="UcDdl1" runat="server" />
td>
tr>
<tr>
<td>
<UC:UcDdl ID="UcDdl2" runat="server" />
td>
tr>
<tr>
<td>
<UC:UcDdl ID="UcDdl3" runat="server" />
td>
tr>
<tr>
<td>
<UC:UcDdl ID="UcDdl4" runat="server" />
td>
tr>
<tr>
<td>
<UC:UcDdl ID="UcDdl5" runat="server" />
td>
tr>
--------------------------------------------------------
.ascx :
<asp:DropDownList ID="ddlList" runat="server" onchange="disp(this);" >
<asp:ListItem Value="Item1">asp:ListItem>
<asp:ListItem Value="Item2">asp:ListItem>
<asp:ListItem Value="Item3">asp:ListItem>
<asp:ListItem Value="Item4">asp:ListItem>
<asp:ListItem Value="Item5">asp:ListItem>
asp:DropDownList>
u can use this based on your requirement
pls mark This is Correct Answer if it is helpful to you
Thank You
manjula dPosted Nov 10, 2014, 2:58 AM
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="CommonAddressDetails.ascx.vb" Inherits="CommonUserControls_CommonAddressDetails" %>
.aspx:
<%@ Register Src="~/INCLUDES/CommonAddressDetails.ascx" TagName="CommonAddressDtls" TagPrefix="UC" %>
Vikram AgrawalPosted Nov 10, 2014, 2:23 AM
Hi manjula,
can u post your .ascx and .aspx code here?
it will very helpful to solve your problem