<script type="text/javascript">
function Enterkey1() {
var UserId = document.getElementById("<%=TxtUserid.ClientID%>").value;
var UserName = document.getElementById("<%=TxtUserName.ClientID%>").value;
var Password = document.getElementById("<%=TxtPassword.ClientID%>").value;
var ConPassword = document.getElementById("<%=TxtConPassword.ClientID%>").value;
var EmailId = document.getElementById("<%=TxtEmailId.ClientID%>").value;
var Country = document.getElementById("<%=TxtCountry.ClientID%>").value;
var date = '0';
PageMethods.password(UserId,UserName,Password,ConPassword,EmailId,Country,date,onSuccess);
return false;
}
#I am
Passing Parameters as
controls's values Using
PageMethods.[WebMethod-Name]
****
Can I
Pass the Control from JavaScript to my WebMethods....
For
Exmaple, I want to
pass my TextBox from javascript's PageMethods to my
c# WebMethod function....to
store "Blank" in <password> and <confirm password=""> if it mismatches in my c# page....
Is It Possible????
Millions of Thanks in advance....
Below is my c# code
[System.Web.Services.WebMethod]
public static string password(string UserId, string UserName, string Password, string ConPassword, string EmailId, string Country, string date)
{
string flag = "";
date = DateTime.Now.ToString("dd/MM/yyyy");
try
{
if (Password.Trim().Replace(" ", "") != ConPassword.Trim().Replace(" ", ""))
{
flag = "false1";
return flag;
}
else
{
MyFunctions Functions = new MyFunctions();
Functions.insertLogin("insert into UserLogin values('" + UserId.Trim().Replace(" ", "") + "','" + UserName.Trim().Replace(" ", "") + "','" + Password.Trim().Replace(" ", "") + "','" + EmailId.Trim().Replace(" ", "") + "','" + Country.Trim().Replace(" ", "") + "','" + date.Trim().Replace(" ", "") + "')");
flag = "true";
return flag;
}
}
catch (Exception ex)
{
return ex.Message.ToString();
}
}