473,770 Members | 5,977 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

checking one checkbox with other Checkbox present in different views of a multiview

22 New Member
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">
&nbsp; &nbsp;&nbsp; </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
Jun 8 '07 #1
0 1443

Sign in to post your reply or Sign up for a free account.

Similar topics

4
6172
by: Shufen | last post by:
Hi, I'm a newbie that just started to learn python, html and etc. I have some questions to ask and hope that someone can help me on. I'm trying to code a python script (with HTML) to get values from a html form that consists of about 10 checkbox and a textbox where user have to key in a value to perform a search. From python tutors, I learned that I have to use the following method:
3
1430
by: Wendy S | last post by:
I have this working, but I don't think it's done efficiently or the best way: <a href="javascript:setAllAccounts(true)">check all</a> <a href="javascript:setAllAccounts(false)">clear all</a> function setAllAccounts(value) { for(i = 0 ; i < document.forms.accounts.length; i++ ) { document.forms.accounts.checked = value; } }
67
4283
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. Unfortunately these ad hominem rhetorts are frequently introduced into purely technical discussions on the feasibility of supporting such functionality in C++. That usually serves to divert the discussion from the technical subject to a discussion of the...
0
1806
by: Fabuloussites | last post by:
I have a page that has multiview control that has two dropdown lists on it. the dropdown controls ARE NOT inside of the multiview. Each drop down is bound using its own sqldatasource conrtol. The multiview is declared below the dropdown controls on another portion of the page. so, here is the progression.. 1) select a category from drowdown one that is bound using sqldatasource1 2) dropdown2 is populated based on selection or...
2
7417
by: Venkata Narayana | last post by:
Hi, You all may be knowing that Connection.isClosed() does not tells us if the underying DB connection is active or not; it only checks if Connection.close() had been previously called or not. One sure shot way to find out this is by executing some dummy SELECT query and catching it via SQLException. This could be done in various DB's as follows: SELECT * from 1 (MS SQL) SELECT * from DUAL(Oracle)
0
2400
by: Jacob Donajkowski | last post by:
Once the user logs in I want to have the users switch from the Roster View to the Profile View and enter their profile infomation and save it. Then the next time they login and go to the Profile View I want the form populated from there profile on the sql server. The code to save the profile works fine. But when the user logs back in they data doesn't load back to the form. The multiview is located inside the LoginView's Logged-In View ....
3
2235
by: cvijaykrishna | last post by:
i have a web based website in which i have some 14 tabs(i took labels) i placed all 14 tabs controls in 14 different views of a multiview and in the click event of each label i am writing protected void lbASurgery_Click(object sender, EventArgs e) { multiView.ActiveViewIndex = 0; }
4
1862
by: cvijaykrishna | last post by:
hi, i am having an apllication which has a multiview if i check one checkbox in a view other checkboxin another view should get checked . i am using server side script and getting it but for immediate results we need to put Autopostback=true for those checkboxes.But i want to use javascripts for this operation can we use it. plese help me in this regard .if possible send me a sample code. thanks and regards vijay
0
927
by: Joe | last post by:
This is another one of those things which I think isn't going to work the way I want... I have a MultiView on a page with 5 views. The use each view as a page. At the bottom of each page there is a Next button. When the user clicks the Next button it just changes the view. This all works fine. The problem is when the user gets to the last "page" I have a finish button which is supposed to save input from the previous views. All the...
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8887
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6679
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5452
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.