i am having a web based application and i am having a problem with it pls check it
Explanationi am sending a sample code plese see it in VS-2005 FOR BETTER UNFERSTANDING
I have a main page called DEFAULT.ASPX
it has a drop down list and 3 contentplace holders
dropdown list With 3 parameters A,B,C if i select any options in drop down list the respective Content place holder will add respective user control and get Visible.
for example A is selected in drop down ------- content place holder A is selected and it will add A.ascx file and get visible
IN the USer control file it has link buttons and a MULTIVIEW, the multiview in turn has some views and each view has checkboxes.
THE PROBLEM
here When i check checkbox A1 from view1 then checkbox A2 in view 2 should automatically checked. (client side and i have use javascript)
example
default.aspx script code
<%@ Page Language="C#" AutoEventWireup ="true" CodeFile="Defau lt.aspx.cs" Inherits="_Defa ult" %>
<%@ Register Src="~/A.ascx" TagName="ucFern andez" TagPrefix="uc1" %>
<%@ Register Src="~/C.ascx" TagName="wucAdm in" TagPrefix="uc3" %>
<%@ Register Src="~/B.ascx" TagName="wucCli ent" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Case Sheet</title>
</head>
<body topmargin=0 bottommargin=0 leftmargin=0 rightmargin=0>
<form id="form1" runat="server">
<div>
<table width="100%">
<tr>
<td colspan="5" align="center" style="height: 85px" >
<!--Hospital Table -->
<fieldset style="backgrou nd-color: #e1f3ff">
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#e1f3f f">
<tr>
<td colspan="6">
</td>
</tr>
<tr>
<!--Select Hospital-->
<td valign="middle" width="16%" align="left">
<asp:Label ID="lblselecton e" runat="server" Font-Size="11pt" Text='select one place holder' Width="188px"
Height="12px" ForeColor="Blac k" Font-Names="Verdana" ></asp:Label>
</td>
<td align="Left" width="16%">
<asp:DropDownLi st ID="ddlSelecton e" runat="server" Font-Size="10pt" Width="120px" AutoPostBack="T rue" >
<asp:ListItem>A </asp:ListItem>
<asp:ListItem>B </asp:ListItem>
<asp:ListItem>C </asp:ListItem>
</asp:DropDownLis t></td>
<!--Case.No(Total)-->
<td align="left" colspan="4">
</td>
<!--Case.No(Hospita l)-->
</tr>
</table>
</fieldset>
<!-- End of Hospital Details-->
</td>
</tr>
<tr>
<td width=100% valign=top style="height: 16px">
<asp:PlaceHolde r ID="Pleacephold erA" runat="server" Visible="False" ></asp:PlaceHolder >
<asp:PlaceHolde r ID="PlaceHolder B" runat="server" Visible="False" ></asp:PlaceHolder >
<asp:PlaceHolde r ID="PlaceHolder C" runat="server" Visible="False" ></asp:PlaceHolder >
</td>
</tr>
<tr>
</tr>
</table>
</div>
</form>
</body>
</html>
default.aspx.cs sample code
using System.Data;
using System.Configur ation;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Web.UI.H tmlControls;
public partial class _Default : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{
if (Page.IsPostBac k == false)
{
if (ddlSelectone.S electedIndex == 0)
{
PlaceHolderB.Vi sible = false;
PlaceHolderC.Vi sible = false;
PleacepholderA. Controls.Clear( );
Control fuc = (UserControl)Pa ge.LoadControl( "~/A.ascx");
PleacepholderA. Controls.Add(fu c);
PleacepholderA. Visible = true;
}
}
else
{
if (ddlSelectone.S electedIndex == 0)
{
PlaceHolderB.Vi sible = false;
PlaceHolderC.Vi sible = false;
Control fuc = (UserControl)Pa ge.LoadControl( "~/A.ascx");
PleacepholderA. Controls.Add(fu c);
PleacepholderA. Visible = true;
}
else if (ddlSelectone.S electedIndex == 1)
{
PleacepholderA. Visible = false;
PlaceHolderC.Vi sible = false;
Control guc = (UserControl)Pa ge.LoadControl( "~/B.ascx");
PlaceHolderB.Co ntrols.Add(guc) ;
PlaceHolderB.Vi sible = true;
}
else if (ddlSelectone.S electedIndex == 2)
{
PlaceHolderB.Vi sible = false;
PleacepholderA. Visible = false;
Control huc = (UserControl)Pa ge.LoadControl( "~/C.ascx");
PlaceHolderC.Co ntrols.Add(huc) ;
PlaceHolderC.Vi sible = true;
}
else
{
}
}
}
}
A.ascx sample code
<%@ Control Language="C#" AutoEventWireup ="true" CodeFile="A.asc x.cs" Inherits="_1" %>
<table width="100%">
<tr>
<td align="center" colspan="5">
<table width="100%">
<tr height="35">
<td align="center" class="ele_butt on" valign="middle" width="20%">
<asp:LinkButt on ID="lbview1" runat="server" Font-Bold="True" Font-Names="Verdana"
Font-Size="10pt" Font-Underline="Fals e" ForeColor="Blac k" Height="100%"
Text="view1" Width="100%" OnClick="lbview 1_Click"></asp:LinkButton> </td>
<td align="center" class="ele_butt on" valign="middle" width="20%">
<asp:LinkButt on ID="lbview2" runat="server" Font-Bold="True" Font-Names="Verdana"
Font-Size="10pt" Font-Underline="Fals e" ForeColor="Blac k" Height="100%"
Text="view2" Width="100%" OnClick="lbview 2_Click"></asp:LinkButton> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<asp:MultiVie w ID="MultiViewA " runat="server">
<asp:View ID="View1" runat="server">
<asp:CheckBox ID="cbxA1" runat="server" Text="A1" /></asp:View>
<asp:View ID="View2" runat="server">
<asp:CheckBox ID="cbxA2" runat="server" Text="A2" /></asp:View>
</asp:MultiView></td>
</tr>
</table>
A.ascx.cs file
sing System;
using System.Data;
using System.Configur ation;
using System.Collecti ons;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Web.UI.H tmlControls;
public partial class _1 : System.Web.UI.U serControl
{
protected void Page_Load(objec t sender, EventArgs e)
{
}
protected void lbview1_Click(o bject sender, EventArgs e)
{
MultiViewA.Acti veViewIndex = 0;
}
protected void lbview2_Click(o bject sender, EventArgs e)
{
MultiViewA.Acti veViewIndex = 1;
}
}
wht should i do please sugesst in this regard pls send me a sample code as it would be helpfull.
thanks and regard
vijay