473,803 Members | 2,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Content Page Controls Disappear When I Click OK on Javascript Alertbox

I am using Page.ClientScri pt.RegisterStar tupScript to throw up a
Javascript alert box. When I click OK on the alert box, all the
controls on my page disappear and I don't understand why. I can View
Source in the browser and see all the controls so I know they are
there, yet they vanish once I click OK. This is happening on a
Content page. The browser is IE 6.0.2900 and I'm running it inside of
Visual Studio 2005.

My master page consists of nothing more than a couple of <div>s and a
ContentPlaceHol der. My content page contains a user control (.ascx)
and an Insert button. The user control is basically the UI for an
underlying business object which contains its own validation logic.
For testing purposes, I have coded the Page_Load method to throw up an
alert() box on any postback. Here's the code, in brief:

<%@ Page Language="C#" MasterPageFile= "~/MasterPage.mast er"
AutoEventWireup ="true" CodeFile="AddUs er.aspx.cs"
Inherits="Deskt opCl_AddUser" %>
<%@ MasterType TypeName="Maste rPage" %>
<%@ Register Src="../ucDesktopClUser .ascx" TagName="ucDesk topClUser"
TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHol derID="ContentP laceHolder1"
Runat="Server">

<h1>Add User</h1><br />

<uc1:ucDesktopC lUser ID="UcDesktopCl User1" runat="server" />
<asp:Button ID="InsertButto n" runat="server"
CausesValidatio n="True" CommandName="In sert"
Text="Insert" OnClick="Insert Button_Click"></asp:Button>

</asp:Content>

- - - - - - - - - - - - - - - -

protected void Page_Load(objec t sender, EventArgs e)
{

if (IsPostBack)
{
string script = "alert(\" Test \");";
ClientScriptMan ager csm = this.ClientScri pt;
if (!csm.IsStartup ScriptRegistere d(this.GetType( ),
"ErrorPopup "))
csm.RegisterSta rtupScript(this .GetType(),
"ErrorPopup ", script, true);
}
{
DesktopClUser user = new DesktopClUser() ;
UcDesktopClUser 1.User = user;
}

}

- - - - - - - - - - - - - - - -

This is the script emitted by RegisterStartup Script:

<script type="text/javascript">
<!--
alert(" Test ");// -->
</script>

Why does clicking on the alert() box cause the controls to disappear?
Is this a browser issue?
Jan 23 '08 #1
0 1924

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
6560
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the courses to pass the correct option value and then be displayed at the following URL: http://www.dslextreme.com/users/kevinlyons/selectResults.html I am passing countries, products, and courses. The first two display
10
2675
by: clintonG | last post by:
Can somebody direct me to documents or source that supports the use of collapsible content that is collapsed by default when the page is loaded? The secondary objective would of course be cross-browser support.for IE (5-6) and browsers derived from Mozilla (varies). Thank you... <%= Clinton Gallagher
1
1824
by: weboweb | last post by:
Hello aspnet experts! I have a design question for the more experienced developers (more than me at least :-)). 1) I have a page in the application I'm building that displays a web user control with a list of folders (let's call it the TREE) 2) There is another control called document list which shows the list of documents for the selected tree folder (let's call it DOCLIST)
4
3017
by: Mori | last post by:
I am using masterPage and I need to populate a textbox that is in a content control with data from popup page that is not part of the master page. This code works if no masterpage is involved. here is the javascript produced: <script>window.opener.document.forms.txtEndDate.value = '7/15/2006';self.close()</script> I basically need to populate txtEndDate on the content page. if
0
1471
by: HP | last post by:
Hi there I have a datalist control with some bound controls in its Item Template and a gridview bound to one of those fields (residing also in Item Template). I've found out that when I click Edit on the gridview (same happens when editing other gridview which is outside the datalist) all datalist bound fields (except the gridview) disappear, and they don't appear after submitting GV changes - they do only after changing value of some
1
1745
by: =?Utf-8?B?am9uZWZlcg==?= | last post by:
I keep getting the message after I converted a regular aspx page to now be based on a master page: "Only Content controls are allowed directly in a content page that contains Content controls." What control, or line of Code is causing the error? here is the offending code :
8
5916
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web clients (Internet Explorer). My flash content was originally brought in via the “flash satay” method, but I have since used some server-side magic do deliver one <objecttag
8
2197
by: Ben | last post by:
Hi, i'm trying to build a simple site navigation (using c#)... i implemented a master page that shows a sidebar user control on the left side, and a content page on the right. i click the link on the sidebar which calls Redirect. problem is that the whole page refreshes... i just want the right side to update to a new content.
5
2341
by: Hannes | last post by:
Hi, How can I read the Content of a directory in my HTML-structure, and show it with an alertbox or something. What I actually want, a Photo-Page. If i load the page, My browser have to check how many directories there are in the map ALBUMS. So if i add an album later I don't have to adjust my code.
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10309
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9119
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7600
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6840
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5496
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4274
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2968
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.