Function CallServerIns ()
{
GetXmlHttp ();
Var rbltable = document. getElementById ("Vote1_RadioButtonList1 ");
Var rbs = rbltable. getElementsByTagName ("INPUT ");
Var selid = "";
For (var I = 0; I <rbs. length; I ++)
{
If (rbs [I]. checked)
{
Selid = rbs [I]. value;
}
}
If (selid = "")
{
Alert ("select the ticket you want to vote ");
Return false;
}
Else
{
Var url = "VoteShow. aspx? Type = "+ escape (" add ") +" & id = "+ escape (selid );
// Var url = "WebForm1.aspx? Username = "+ escape (user) +" & sex = "+ escape (sexinfo) +" & age = "+ escape (age) + "& tel =" + escape (tel) + "& addr =" + escape (addr );
Xmlhttp. open ("post", url, true );
Xmlhttp. onreadystatechange = CallBackIns;
Xmlhttp. send ();
Return false;
}
}
Function CallBackIns ()
{
Var strInfo = "";
Var divid = document. getElementById ("InsInfo ");
If (xmlhttp. readyState = 1)
{
// Alert ("voting ...");
// StrInfo = "voting ...";
Divid. style. visibility = "visible ";
Divid. innerHTML = strInfo;
}
If (xmlhttp. readyState = 4)
{
StrInfo = xmlhttp. responseText;
/* Divid. style. visibility = "hidden ";
Var di = document. getElementById ("asd1 ");
Var dii = document. getElementById ("asd2 ");
Var diii = document. getElementById ("asd3 ");
Di. style. visibility = "visible ";
Dii. style. visibility = "visible ";
Diii. style. visibility = "visible ";
Diii. innerHTML = strInfo ;*/
Alert (strInfo );
}
}
//////////////////////////////////////// //// // The above is the js script //////// //////////////////////////////////////// //////////////////////////////////////// ////////
<Input onclick = "return showvote ();" type = "image" src = "images/a_chaka.jpg">
//////////////////////////////////////// /// // The above is the aspx page //////// //////////////////////////////////////// //////////////////////////////////////// ////////
Private void Vote (int id)
{
If (int) Session ["Vote"]! = 1)
{
Dal. UpdateTotle (id );
Session ["Vote"] = 1;
Response. Write ("Vote successful !! ");
Response. End ();
}
Else
{
Response. Write ("Please do not vote again! ");
Response. End ();
}