DHTML Window widget (v1.03)
http://www.dynamicdrive.com/dynamici...ndow/index.htm
Hi,
I am using asp.net 2.0, C# as the code behind in my application.
The script works well on its own, ie the window pops up closes , minimizes etc...
But when we have server side controls eg a Button, the click does not execute the server side code. any javascript will execute. but the server side code does not execute. there is no other javascript in the page. It is just a plain div with a asp.net button inside. if the button is placed outside the div which needs to be popped up, the server side code executes. but when inside the div it does not execute. please advice the html code is as follows:
This code button click does not execute the server side code
***********************************************
// div that has to be popped up
<div id="somediv" style="display: none">
<p style="height: 400px">
This is some content within a DIV, shown inside this window instead</p>
//the asp.net button
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
//Button1_Click ---> server side function written in c#
</div>
<div>
<a href="#" onclick="var divwin=dhtmlwindow.open('divboxaa', 'div', 'somediv', '#4: DIV Window Title', 'width=450px,height=300px,left=200px,top=150px,resize=1,scrolling=1'); return true;">
<b>Create Open Window 4</b></a>
</div>
*********************************************************
This code button click executes the server side code
***********************************************
// div that has to be popped up
<div id="somediv" style="display: none">
<p style="height: 400px">
This is some content within a DIV, shown inside this window instead</p>
</div>
<div>
<a href="#" onclick="var divwin=dhtmlwindow.open('divboxaa', 'div', 'somediv', '#4: DIV Window Title', 'width=450px,height=300px,left=200px,top=150px,resize=1,scrolling=1'); return true;">
<b>Create Open Window 4</b></a>
//the asp.net button
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
//Button1_Click ---> server side function written in c#
</div>
********************************************************
As you see in the above html if the button is placed inside the div which needs to be popped up, it does not execute the server side code. but in the second case if it is outside the div it executes the server side code.



Reply With Quote

Bookmarks