Click here to Skip to main content
15,922,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My fuction is this ...



C#
protected void BtnDonld_Click(object sender, EventArgs e)
   {
         string text1 = User.Identity.Name.ToString();
         if (text1 == "" || text1 == string.Empty)
         {
             Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowMessage", string.Format("<script type='text/javascript'>alert('{0}')</script>", "For Download Pdf You have to Login"));
}



And Pop uP Coding is this how i call this on the above function

<a href = ""javascript:void(0)"  önclick = "document.getElementById('light').style.display='block';document.getElementById('fade').style.display='block'">here</a>
Posted
Updated 7-Oct-13 23:01pm
v2
Comments
pankaj mishra 1234 8-Oct-13 7:48am    
//ASPX PAGE
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="dialog.aspx.cs" Inherits="dialog" %>

<!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 runat="server">
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script>
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css"
rel="stylesheet" type="text/css" />
<script type="text/javascript">
function ShowPopup() {
$(function () {
// $("#dialog").html(message);
$("#dialog").dialog({
title: "login",
modal: true
});
});
};
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="dialog" style="display: none; width:40%">
your login design
</div>
<asp:Button ID="btnShowPopup" runat="server" Text="download" OnClick="btnShowPopup_Click" />
</form>
</body>
</html>


//ON BUTTON CLICK


protected void btnShowPopup_Click(object sender, EventArgs e)
{
string text1 = "";
if (text1 == "" || text1 == string.Empty)
{

ClientScript.RegisterStartupScript(this.GetType(), "Popup", "ShowPopup();", true);
}
}
Swinky_Talwar 8-Oct-13 7:54am    
Thnx ...will it show login pop up?
pankaj mishra 1234 8-Oct-13 7:58am    
ya it will show pop up, u can try it if u have any issue replay me for the same

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