Click here to Skip to main content
15,920,828 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
i have login as pop up box in master page, and i use jquery to show pop up box

i use asp:button , to onclick ..but function on

<asp:Button ID="psearch" runat="server" onclick="usearch_Click" Text="LOG IN" />

usearch_Click is never called in masterpage.master

Adding code

<input class="loginName required" type="text" id="loginname" value="Username" name="loginName" />
			<input class="loginPass required" type="password" id="loginpassword" value="Password" name="loginPass" />

<input type="submit" value="LOG IN" id="LoginBtnValue"/>


on login click

function GetLoginDetails(UserName,UserPassword)
		{
			//alert(UserName+UserPassword);
			var returnurl = window.location.href;
			
			$.ajax({
				type: "POST",
				contentType: "application/json; charset=utf-8",
				url: "Default.aspx/GetLoginDetails",
				data: "{'UserName':'" +UserName+ "'," + "'UserPassword':'"+UserPassword +"','returnurl':'"+returnurl+"'}",
				success: function(data) {
					var theHtml = data.d;
					
					if(data.d=="loginerror")
					{
						alert('Username or password is incorrect');
					}
					else
					{
						window.location.href = data.d;
					}
				},
				error: function(xhr, textStatus, errorThrown) {
					 alert("Login FAIL: " + xhr + " " + textStatus + " " + errorThrown);
				}
			});
		
		}


with values

and in default.aspx.cs ,
web method like

[WebMethod]
    public static string GetLoginDetails(string UserName, string UserPassword,string returnurl)
    {


}

In this i want to
[WebMethod]
    public static string GetLoginDetails(string UserName, string UserPassword,string returnurl)
    {

}



what i want is to change master page text login to logoff with name (for exp, logoff , welcome name)
Posted
Updated 14-Jan-14 22:29pm
v2
Comments
Karthik_Mahalingam 15-Jan-14 3:32am    
post your jquery code...
Please post more codes.
maulikshah1990 15-Jan-14 3:35am    
which jquery code ???popup or ajax post
maulikshah1990 15-Jan-14 4:11am    
my html code in master page is



on the above click, a pop up box with below html code

<input class="loginName required" type="text" id="loginname" value="Username" name="loginName" />
<input class="loginPass required" type="password" id="loginpassword" value="Password" name="loginPass" />

<input type="submit" value="LOG IN" id="LoginBtnValue"/>

on login click

function GetLoginDetails(UserName,UserPassword)
{
//alert(UserName+UserPassword);
var returnurl = window.location.href;

$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Default.aspx/GetLoginDetails",
data: "{'UserName':'" +UserName+ "'," + "'UserPassword':'"+UserPassword +"','returnurl':'"+returnurl+"'}",
success: function(data) {
var theHtml = data.d;

if(data.d=="loginerror")
{
alert('Username or password is incorrect');
}
else
{
window.location.href = data.d;
}
},
error: function(xhr, textStatus, errorThrown) {
alert("Login FAIL: " + xhr + " " + textStatus + " " + errorThrown);
}
});

}

with values

and in default.aspx.cs ,
web method like

[WebMethod]
public static string GetLoginDetails(string UserName, string UserPassword,string returnurl)
{


}

In this i want to [WebMethod]
public static string GetLoginDetails(string UserName, string UserPassword,string returnurl)
{

}


what i want is to change master page text login to logoff with name (for exp, logoff , welcome name)

how to get master page control in content page web method

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900