By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,691 Members | 1,152 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,691 IT Pros & Developers. It's quick & easy.

Simple JScript

P: n/a
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
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi

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

Button.AutoPostBack = false;
HTH
Prasad

"Jenny" <j.********@SPAMx-mail.net> wrote in message
news:03****************************@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

Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.