<%@ Page Language="VB"
AutoEventWireup="false"
CodeFile="Default.aspx.vb"
Inherits="_Default"
%>
<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1"
runat="server">
<title>Untitled Page</title>
<script src="/JsFiles/jquery1.4.js"
type="text/javascript"></script>
<script type =
"text/javascript" language = "javascript">
$(document).ready(function() {
$('#button1').click(function() {
var a = $('#Label1').html();
var b = $('#TextBox1').val();
var c = $('#Button1').val();
var d = $('#CheckBox1').is(':checked');
$('.rbl').each(function() {
var checked =
$(this).find('input:radio:checked');
if
(checked.length == 0) {
alert("pls select atleast one radio button");
return;
}
else {
if
(checked.val() == 1) { alert("checked 1");
}
if (checked.val()
== 2) { alert("checked 2"); }
if
(checked.val() == 3) { alert("checked 3");
}
}
});
var checking =
$("[name='radiobutton1']:checked").val();
alert(checking);
$('#display').hide();
var l = "a=" + a;
$.ajax({
url: "ajaxrequest.aspx",
type: "POST",
data: l,
success: function(a) { if (a
== "success") { alert("successed"); } else
{ alert(a); }; },
error: function(a) { alert(a); }
});
});
});
</script>
</head>
<body>
<form id="form1"
runat="server">
<div>
<asp:Label ID="Label1" runat="server"
Text="ramlabel-ram"></asp:Label>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<input type ="button"
id='button1' runat = "server" value
= "button"
/>
<asp:LinkButton ID="LinkButton1"
runat="server">LinkButton</asp:LinkButton>
<%-- <asp:DropDownList
ID="DropDownList1" runat="server">
</asp:DropDownList>--%>
<asp:RadioButton ID ="RadioButton1"
runat = "server" Value
= "4"
GroupName = "radiobutton1" />
<asp:RadioButton ID ="RadioButton2"
runat = "server" Value
= "5"
GroupName = "radiobutton1" />
<asp:RadioButton ID ="RadioButton3"
runat = "server" Value
= "6"
GroupName = "radiobutton1" />
<asp:DropDownList ID = "dropdownlist1" runat
= "server"
>
<asp:ListItem value= "7">ddl1</asp:ListItem>
<asp:ListItem value= "8">ddl1</asp:ListItem>
</asp:DropDownList>
<asp:RadioButtonList ID="RadioButtonList1"
class = "rbl" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text = "sum1" Value
= "1"></asp:ListItem>
<asp:ListItem Text = "sum3" Value
= "3"></asp:ListItem>
<asp:ListItem Text = "sum2" Value
= "2"></asp:ListItem>
</asp:RadioButtonList>
<asp:CheckBox ID="CheckBox1"
runat="server"
/>
<asp:CheckBox ID="CheckBox2"
runat="server"
/>
<div id ="display"
>
hai this is for testing
purpose by roja.
</div>
</div>
</form>
</body>
</html>
in the ajaxrequest.aspx page
<%@ page Language ="VB"
ValidateRequest =
"false" %>
<%@ Import Namespace ="system"
%>
<%@ Import Namespace = "system.data" %>
<%@ Import Namespace ="system.data.sqlclient"
%>
<%@ Import Namespace = "system.web.ui.page" %>
<%@ Import Namespace = "system.configuration" %>
<% Response.AddHeader("Pragma",
"no-cache") %>
<% Response.AddHeader("cache-control","no-cache,must-revalidate") %>
<script language ="vb" type = "text/VB"
runat ="server"
>
Protected Sub Page_Load(ByVal
sender As Object,
ByVal e As
System.EventArgs)
Response.Write("success")
End Sub
</script>