Click here to Skip to main content
15,909,030 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionsearch a string Pin
david boon21-Jun-06 2:29
david boon21-Jun-06 2:29 
AnswerRe: search a string Pin
Elina Blank21-Jun-06 4:21
sitebuilderElina Blank21-Jun-06 4:21 
Questioncall back in asp .net 1.1 Pin
mehnazash21-Jun-06 2:28
mehnazash21-Jun-06 2:28 
AnswerRe: call back in asp .net 1.1 Pin
Dan Satria23-Jun-06 10:27
Dan Satria23-Jun-06 10:27 
Questionclient side validation Pin
DKM_DKM21-Jun-06 2:21
DKM_DKM21-Jun-06 2:21 
AnswerRe: client side validation Pin
minhpc_bk21-Jun-06 15:47
minhpc_bk21-Jun-06 15:47 
GeneralRe: client side validation Pin
DKM_DKM25-Jun-06 21:02
DKM_DKM25-Jun-06 21:02 
GeneralRe: client side validation Pin
minhpc_bk26-Jun-06 7:37
minhpc_bk26-Jun-06 7:37 
Below is a quick example of client side validation so that more than 2 checked checkboxes are not allowed:
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TreeView ID="TreeView1" runat="server">
            <Nodes>
                <asp:TreeNode ShowCheckBox="True" Text="Root1" Value="Root1">
                    <asp:TreeNode ShowCheckBox="True" Text="New Node 1" Value="New Node 1">
                        <asp:TreeNode ShowCheckBox="True" Text="New Node 2" Value="New Node 2"></asp:TreeNode>
                    </asp:TreeNode>
                </asp:TreeNode>
                <asp:TreeNode  ShowCheckBox="True" Text="Root 2" Value="Root 2"></asp:TreeNode>
                <asp:TreeNode ShowCheckBox="True" Text="Root 3" Value="Root 3"></asp:TreeNode>
            </Nodes>
        </asp:TreeView>
        <asp:TextBox style="display:none" ID="hidCheckBoxCounter" runat="server"/>
        <asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="Oops! You cannot pick up more than 2 nodes." ControlToValidate="hidCheckBoxCounter" ValueToCompare="2" Operator="LessThanEqual"></asp:CompareValidator> 
        <script type="text/javascript">
            var inputs = document.body.getElementsByTagName("input");
            for(var index = 0; index < inputs.length; index ++)
            {
                var input = inputs[index];
                if(input.getAttribute("type")=="checkbox" && input.getAttribute("id").indexOf("TreeView1")>=0)
                {
                   input.on_click = CheckBox_OnClick;
                }
            }
                        
            function CheckBox_OnClick()
            {
                var counter = document.getElementById("hidCheckBoxCounter");
                if(event.srcElement.checked)
                {
                    counter.value++;
                }
                else
                {
                    if(counter.value>0)
                        counter.value--;
                }
            }
        </script>
    </div>
        <asp:Button ID="Button1" runat="server" Text="Submit" />
    </form>
</body>
</html>

QuestionCallback in ASP .Net 1.1 Pin
mehnazash21-Jun-06 2:21
mehnazash21-Jun-06 2:21 
QuestionHow to access value from custom Web control Pin
seee sharp21-Jun-06 2:01
seee sharp21-Jun-06 2:01 
AnswerRe: How to access value from custom Web control Pin
seee sharp21-Jun-06 3:37
seee sharp21-Jun-06 3:37 
AnswerRe: How to access value from custom Web control Pin
Dan Satria23-Jun-06 10:16
Dan Satria23-Jun-06 10:16 
QuestionApplication[cache] before app starts Pin
Malcolm Smart21-Jun-06 1:56
Malcolm Smart21-Jun-06 1:56 
AnswerRe: Application[cache] before app starts Pin
minhpc_bk21-Jun-06 15:13
minhpc_bk21-Jun-06 15:13 
QuestionQuery Problem Pin
varshavmane21-Jun-06 1:39
varshavmane21-Jun-06 1:39 
AnswerRe: Query Problem Pin
albCode21-Jun-06 1:58
albCode21-Jun-06 1:58 
GeneralRe: Query Problem Pin
varshavmane21-Jun-06 2:00
varshavmane21-Jun-06 2:00 
GeneralRe: Query Problem Pin
Malcolm Smart21-Jun-06 2:07
Malcolm Smart21-Jun-06 2:07 
GeneralRe: Query Problem Pin
varshavmane21-Jun-06 2:16
varshavmane21-Jun-06 2:16 
GeneralRe: Query Problem Pin
Malcolm Smart21-Jun-06 2:21
Malcolm Smart21-Jun-06 2:21 
GeneralRe: Query Problem Pin
albCode21-Jun-06 2:10
albCode21-Jun-06 2:10 
GeneralRe: Query Problem Pin
varshavmane21-Jun-06 2:19
varshavmane21-Jun-06 2:19 
GeneralRe: Query Problem Pin
Malcolm Smart21-Jun-06 2:27
Malcolm Smart21-Jun-06 2:27 
GeneralRe: Query Problem Pin
albCode21-Jun-06 2:28
albCode21-Jun-06 2:28 
GeneralRe: Query Problem [modified] Pin
varshavmane21-Jun-06 2:59
varshavmane21-Jun-06 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.