Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Simple JScript

    Hi all,

    I wrote a simple asp.net with JScript. But it doesn't work
    properly. And I don't know why!

    The CodeBehind:

    Public Class WebForm1
    Inherits System.Web.UI.Page
    ....

    Private Sub Page_Load(ByVal sender As System.Object,
    ByVal e As System.EventArgs) Handles MyBase.Load

    Button1.Attributes.Add("AutoPostBack", "False")
    Button1.Attributes.Add("onclick", "openPopup();")

    End Sub

    End Class

    And the html in VisualStudio:

    <HTML>
    <HEAD>
    <title>WebForm1</title>
    <meta content="Microsoft Visual Studio .NET 7.1"
    name="GENERATOR">
    <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    <meta content="JavaScript" name="vs_defaultClientScript">
    <meta
    content="http://schemas.microsoft.com/intellisense/ie5"
    name="vs_targetSchema">
    <SCRIPT language="JScript">
    var oPopup = window.createPopup();
    function openPopup()
    {
    var oPopBody = oPopup.document.body;
    oPopBody.innerHTML="<DIV>This is a popup!</DIV>";
    oPopup.show(15,150,50,50,document.body);
    }
    </SCRIPT>
    </HEAD>
    <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
    <asp:Button id="Button1" style="Z-INDEX: 101; LEFT:
    174px; POSITION: absolute; TOP: 95px" runat="server"
    Text="Button" Width="233px" Height="64px"
    CausesValidation="False"></asp:Button></form>
    </body>
    </HTML>

    Once started and clicked a message (This is a popup)
    appears for some ms on the screen (And it doesn't look like
    a popup window).

    thanks for each help on this

    Jenny
    Jenny Guest

  2. Similar Questions and Discussions

    1. Confusion between Jscript and Javascript
      Can someone explain here what is the difference if any between JScript with extentions .js and Javascript. I am trying to do a site and cant get...
    2. JScript (.js) in htlm
      I am new here and trying ot self learned on Dynamic Web design. I am using Dreamweaver for this task. I have a quesrtion concerning the JSCript...
    3. MX 7 breaks CF 4 Jscript on NS 4.79
      I've integrated a javascript-based popup menu function from www.dynamicdrive.com into my Cold Fusion 4.01 CFM file. This is a cross-platform site...
    4. problem with jscript and swf
      You can also set the background of the swf to be "opaque" or "window" (and "transparent"). If you're using on NN, why doesn't make the menu in Flash...
    5. JScript
      Hi all, how can I start a client side JScript function instead of doing a postback if a button (webforms) is clicked? Thx Jenny
  3. #2

    Default Re: Simple JScript

    Hi

    AutoPostBack = false should be set at Server Side and not at ClientSide. It
    should be

    Button.AutoPostBack = false;


    HTH
    Prasad

    "Jenny" <j.malloyNO@SPAMx-mail.net> wrote in message
    news:03e501c35fcf$38234390$a401280a@phx.gbl...
    > Hi all,
    >
    > I wrote a simple asp.net with JScript. But it doesn't work
    > properly. And I don't know why!
    >
    > The CodeBehind:
    >
    > Public Class WebForm1
    > Inherits System.Web.UI.Page
    > ...
    >
    > Private Sub Page_Load(ByVal sender As System.Object,
    > ByVal e As System.EventArgs) Handles MyBase.Load
    >
    > Button1.Attributes.Add("AutoPostBack", "False")
    > Button1.Attributes.Add("onclick", "openPopup();")
    >
    > End Sub
    >
    > End Class
    >
    > And the html in VisualStudio:
    >
    > <HTML>
    > <HEAD>
    > <title>WebForm1</title>
    > <meta content="Microsoft Visual Studio .NET 7.1"
    > name="GENERATOR">
    > <meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
    > <meta content="JavaScript" name="vs_defaultClientScript">
    > <meta
    > content="http://schemas.microsoft.com/intellisense/ie5"
    > name="vs_targetSchema">
    > <SCRIPT language="JScript">
    > var oPopup = window.createPopup();
    > function openPopup()
    > {
    > var oPopBody = oPopup.document.body;
    > oPopBody.innerHTML="<DIV>This is a popup!</DIV>";
    > oPopup.show(15,150,50,50,document.body);
    > }
    > </SCRIPT>
    > </HEAD>
    > <body MS_POSITIONING="GridLayout">
    > <form id="Form1" method="post" runat="server">
    > <asp:Button id="Button1" style="Z-INDEX: 101; LEFT:
    > 174px; POSITION: absolute; TOP: 95px" runat="server"
    > Text="Button" Width="233px" Height="64px"
    > CausesValidation="False"></asp:Button></form>
    > </body>
    > </HTML>
    >
    > Once started and clicked a message (This is a popup)
    > appears for some ms on the screen (And it doesn't look like
    > a popup window).
    >
    > thanks for each help on this
    >
    > Jenny

    Prasad Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139