Absolutely cool, how to troubleshoot JavaScript scripting in asp.net (using server controls to execute client script)
Source: Internet
Author: User
A lot of people in the Forum asked how to open a new window in the ASP.net without toolbars and so on, everyone said to use JavaScript to solve, good this fact can be solved, but using universal HTML control but can't use ASP.net code to manipulate him.
Now I will solve this problem for all of you.
Create a window
Open a new window of the program I must be very familiar with the people, simply say
window.open (URL, [name], [features])
URL is the address of the window you want to open
Name is the new open window
Features is a new window of some properties, such as size, etc.
Open a window take advantage of server properties
The simplest way to add client script to a server control is to add a property to the server control in Page_onload, and the following code is to add the onclick event to the Server command button control to be placed in the Page_onload event.
Dim Features as String = _
"Height=320;width=160;left=100;top=50;location=no;menubar=no;resizable=yes;scrollbars=no;status=no;titlebar= Yes;toolbar=no "
Dim Sscript as String = window.open (' customersearch.aspx ', ', ' "& Features & ');"
' Add this to the server control's properties
BTNSEARCH.ATTRIBUTES.ADD ("onclick",
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.