473,473 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

for closing the webform

6 New Member
hi.........
i want to close the webform in asp for that i write this code....in close button click

Expand|Select|Wrap|Line Numbers
  1. protected void Button6_Click(object sender, EventArgs e)
  2.     {
  3.         Response.Write("<script              language='javascript'>window.open('','_self',''); window.close();</script>");
  4.     }

then i got this error.....
Error: Sys.WebForms.PageRequestManagerParserErrorExceptio n: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '<script language='ja'.

please anyone help me......
i am new to asp.net....
please clear my error.....

Thanks in advance......
Oct 31 '11 #1
1 2008
Frinavale
9,735 Recognized Expert Moderator Expert
Well that's because you're using Response.Write in your C# code.
When you do this, the text is inserted at a random place in the HTML that it sent to the browser. It is typically inserted before the <body> or <head> tags and so your HTML becomes invalid.

It sounds like you are using Ajax on your page, so I suggest that you register the script that closes the window with your ScriptManager to get around the problem.

-Frinny
Nov 1 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Andrew | last post by:
Hi, Until now, I have used a single webform for my web app, and everything's been OK. Now, I've decided to create a main menu webform. So, I've got two webforms. Using Visual Studio .NET (with...
1
by: | last post by:
How can I close a webform from withing C# (not HTML)?
6
by: Newbie | last post by:
Hi! In C# asp.net, how do I close a popup window (an aspx webform)? I have a link button handler below: private void LinkButton1_Click(object sender, System.EventArgs e) { this. ...
1
by: hqdtech | last post by:
how to refresh webform from other webform I have 2 webform, i want if webform A was close then webform B wil refresh. And the problem second: how to catch packet on the network in C#. ...
1
by: Chirag Malvi | last post by:
hello all, I am developing the web application using ASP.net and VS.2003 IDE. here is the situation which i want to implement. 1) User is browsing some webform. I want to trap this event....
2
by: lakshmikandhan | last post by:
Hi All, Can anyone tell me how to handle a event while we are closing a webform in asp.net??? I have to perform some server side action while we are closing a webform.So plz give me some idea...
5
by: kdfake | last post by:
I cant figure out how to do it... Any clues? R -- --------------------------------- --- -- -
2
by: Luqman | last post by:
How can I open another WebForm in ASP.Net / VS 2005 without closing the Current Webform. I tried using Server.Transfer("Form2.Aspx",True) on Button_Click of Form1 but it close the current web...
5
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have start web form and when the user clicks a button (server.transfer) they are directed to the second webform. I was wondering if there is a way to create an instance of the first webform...
6
by: =?Utf-8?B?UGF1bA==?= | last post by:
I am looking for a java script to close a web form that I can attatch to a button click event. I am using vs2005, c#. Thanks -- Paul G Software engineer.
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
1
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...
0
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...
0
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...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.