-1

I have made a page in asp.net and c#, i want this page to open up as a popup window. what should i do with the code? I am creating a student management system, when i click to add a student and the student already exists, i want a popup window to occur and ask whether you want to go back or you want to search the student using C# coding?

4

2 回答 2

3

使用 JavaScript 的窗口function

var popup = window.open('url');

或确认function

function showConfirm()
{
  var r=confirm("Do you want to go back or you want to search the student?")
  if (r==true)
  {
     alert("You pressed OK!")
  }
  else
  {
   alert("You pressed Cancel!")
  }
}
于 2013-07-12T14:28:16.840 回答
0

JavaScript的方式:

<head runat="server">
    <title></title>
    <script type="text/javascript">
        function abrir(url, width, height)
        {
            window.open(url, '', width, height);
        }
    </script>


</head>
<body>
    <form id="form1" runat="server">
    <div>
        <a href="../yourpage.aspx"><img id="btnAyuda" onclick="abrir('../yourpage.aspx',750, 520);return false" /></a>
    </div>
    </form>
</body>
于 2013-07-12T14:37:14.563 回答