Monday, July 26, 2010

Versed in pop-up window for ASP.NET



As Microsoft's latest tools to create dynamic Web sites, ASP.NET compared to ASP and JSP Web Programming in changing the way the original had made great strides grow. Its code and page separation technology (CodeBehind) and a good Web server control for the programmer to provide a more in keeping with the traditional server-side Web programming development methods. However, traditional Web programming or programming with different characteristics, which determine the ASP.NET programming must be some special skills to complete the program requirements, pop-up window is representative of the way of such programming. A lot of programming books on the pop-up window with the words to silent or off, seems to see the great use of pop-up window, but heaven and earth. This will pop-up window, you unlock most of the problems in use.

In order to improve site access concurrency and throughput, as with other server script, ASP.NET also uses a client-side script to ease server stress. ASP.NET now (version 1.1) does not directly support the pop-up windows, must javascript (or VBScript) to use client-side pop-up window.

First, a warning window and in the CodeBehind in a way using client script

In the browser to pop up a simple warning window, you can use the javascript statement:

window.alert ([sMessage])

Which, sMessage is message. Unfortunately, such a pop-up window is only an "OK" button, and can only play a role in tips. If we want to delete the record when asked about the pop-up a pop-up window, then you need to use:

bConfirmed = window.confirm ([sMessage])

Where: bConfirmed is the return value, sMessage is message. The pop-up window there are two options: "OK" or "abandoned", the return value of their choice on the bConfirmed, the available code to make judgments.

In order to improve code reusability and readability, should enable javascript and Codehind fused with each other. There are usually two ways to achieve such results.

(1) use Response.Write method:

Use the ASP Response.Write method early era have been supported. It can write client code is a very convenient and intuitive way. The following code demonstrates how to use the Response.Write method to display a warning message.

Private Sub btAlert_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btAlert.Click

'Response.Write method and the alert window shows.

Response.Write ("")

End Sub

(2) the use of RegisterXXX method

If you look at the generated HTML code Response.Write, you will find Response.Write method to generate the code is written to the beginning of the HTML code that tag. At this point, all the HTML objects are not generated, if it is to use the HTML within the object, and interact with, there will be "object not found" error. Therefore, I recommend a more consistent way ---- CodeBehind way to use RegisterXXX method. RegisterXXX include: RegisterClientScriptBlock, RegisterStartupScript and used to determine the IsStartupScriptRegistered function.

RegisterStartupScript prototype is:

Overridable Public Sub RegisterStartupScript (_

ByVal key As String, _

ByVal script As String _

)

Including: key that uniquely identifies the script, script string representing the script.

Prototype and RegisterStartupScript RegisterClientScriptBlock the same two functions is to contain different script code is written to the HTML file a different location. RegisterClientScriptBlock elements in the Page object issued immediately after the opening tag of client-side script, RegisterStartupScript is the element in the Page object tag issued before the end of the script. If your scripts have the page object (doucument objects) to interact with the statement (which we later see examples), the recommended RegisterStartupScript, otherwise if it is to client-side script execution as early as possible, you can use RegisterClientScriptBlock or Response.Write.

In order to prevent repeated by adding the script in the page in the registration script ReisterStartupScript / RegisterClientScriptBlock registered to use the key as the Key, then the program can be used to judge IsClientScriptBlockRegistered.

The following example will demonstrate the use RegisterClientScriptBlock to confirm the use.

Private Sub btConfirm_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btConfirm.Click

'Presentation method and confirm the window RegisterClientScriptBlock

If (Not IsClientScriptBlockRegistered ("clientScript")) Then

'Determine whether the script has been added, not the join.

Dim strScript As String

strScript = ""

'Register script

RegisterClientScriptBlock ("clientScript", strScript)

'If you select "No", then continues.





1, pop-up page specified

Light a prompt window is still far from meeting our requirements, in the process, we often need to specify the pop-up page. At this point you can use javascript's window.open method. With the previous RegisterClientSciptBlock way, we can achieve the specified pop-up page.

The following code shows how to specify the pop-up page:

Private Sub btWinOpen_Click (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btWinOpen.Click

'Using window.open and registerStartupScript simple demonstration.

If (Not IsClientScriptBlockRegistered ("OpenScript")) Then

'Determine whether the script has been added, not the join.

Dim strScript As String = ""

RegisterStartupScript ("OpenScript", strScript)

End If

End Sub

Uses Window.open way to pop a new page, only one parameter: the new pop-up window URL address. The fact that there are more parameters in window.open method, but this is javascipt simple, and we will not be detailed here Annotated. If you have a related issue, please consult MSDN.

This procedure be used directly in IE everything is normal. But if you are using the class as GoSurf, MyIE2, NetCapter like the browser, then, unfortunately! You will not see the pop-up window. This is what we will be discussing the issue pop-up filter.

Second, non-standard IE browser pop-up discussion of the filtration behavior

The overflowing window advertising unbearable overwhelming number of Internet users have to give up the standard of advertising harassment to use IE browser, such as GoSurf, MyIE2, NetCapter this page using the IE core and multi-screen advertising the software automatically. It is said that the upcoming release of IE6 sp2 in the Microsoft ad window to join the block function. This is a good thing that most Internet users, of course, be for the programmer, the way we use pop-ups and general advertising is not essentially different, so the window will be pop-up window manager indiscriminate white block, the results of course, we do not want to see. Is there a standard way to make a normal pop-up window then? This requires that we understand the browser to block ads principle. Typically uses ad blocking ads filtering the following three ways:

(1), based on window title block approach

In the reference [1] presents a window title filtering based on block means. Its principle is to regularly check all of the IE window title, and then have some on list (maintained by the program, an array list) to compare, if the same, we will close this window. Obviously, this approach has many defects, it blocked all the pop-up windows, tightly managed, very few actually use the program. However, according to the deformation it down fairly common use. That is, based on the window title name of the smart filter technology, which is under the title of pop-up window containing the keywords on the ad ban, which has made to improve the filtering effect of the exploration well.

(2), based on window type and location of block mode

Reference [2] presents a window class and location-based blocking mode. Its analysis of the normal browser window class name is IEFRAME and CabinetWClass, and ad window class name is CabinetWClass. Further analysis found that: ad window WorkerA classes and Shell DocObject View class rect.top values are the same, normal IE window WorkerA classes and Shell DocObject View class rect.top values are not the same. Based on the above two procedures can write a killer ad.

In fact, I have the program universal skepticism. Because I used Spy + + analysis found that in Windows2000 (I use the operating system) in, IE window class for the IEFrame. Also, because Win2000 is a Unicode based operating system code, so there is no WorkerA class, and to WorkerW class instead. At the same time, there was no rect.top not the same situation, because I did not WindowsXP operating system, it can not be further tests for WindowsXP.

(3), based on IE COM component block approach

These two methods are the IE window as a normal Windows window treatment, to judge. In fact, IE is a typical browser-based COM components, all browser based on IE core files are packaged shdocvw.dll, and then writing a corresponding BHO code. The only way to achieve real control of IE browser, not the method of one or two such and inadequate.

Reference [3] presents a pop-up based on IE kernel block method. It can block pop-ups before they open. The principle is: when IE opens a new window will be triggered when NewWindow event, the Executive OnNewWindow2 ([out] IDispatch *, [out] BOOL * bCancel) method. Override this method to determine whether to open a new window incident occurred in the view after the page has been downloaded. If so, that is, a normal pop-up window, contrary to intercept.

Browser such as Gosurf override Shocvm.dll component itself, so use the third method, it naturally became a matter of course. However, sometimes in the course of discovery, ad filter is not perfect, but the basic principle of the case.







Recommended links:



Easy Audio CD Players



Do not let the knowledge base has become Garbage



Catalogs Newsgroup Clients



Liu Xu Micro point: there will be more soon to be opened Insider



Considerate: Foxmail 6.0 beta 3 the beginning of experience



converting mov to wmv



Forbes: Goodbye, Alibaba?



comments Text Or Document Editors



Chinese input method commonly used fast switching



avi to mp4 Converter



AJAX Push and Pull methods comparison



.MKV file



Workplace COMPETITIVENESS "soft skills"



flv to SWF



What is most needed boss



Saturday, July 24, 2010

Beautiful images grabbed



Analysis: Xiaoyu Columbia

Download the software now much can be said after another, dazzling. Which software you know is you really need it? We present below several popular screenshot software, I hope you can find that really fit your own paragraph.

1.HyperSnap-DX Pro

Not to mention HyperSnap-DX Pro did a very good screen capture function, a single interception forms, simple operation, supported image formats comprehensive enough to attract a large number of users. The image editing features is its another feature of the screenshot and edit images to achieve the "perfect match." HyperSnap powerful, professional and attractive features, the software has been regarded as a classic shot.

2.SnagIt!

SnagIt! Is an old screenshot of the software, its name is legendary among users, this screenshot of the software to intercept pictures, edit images and manage images for a triple, and further expansion of the screenshots of the content, the scope will be extended to capture text and image areas, the scope is very suitable for use by those who need shots.

3.UltraSnap Pro

UtraSnap Pro screenshot relatively commonly used software, although the small size, functionality is very powerful, and it absorbed the other screenshot software, the advantages of easy and convenient operation. UltraSnap function can not be very powerful, but the shots, editing done quite perfect. The interception of the picture, we often need to intercept that portion of focused, may also need to be preserved after partial treatment, this time UltraSnap is your best choice.

4.Capture Professional

This is the Creative Softworx company produced a good shot of strong software functionality, users can use the screenshot guide, hot keys and menus screenshots. Software to capture up to 12 kinds of ways, including manual, automatic or other use of capture wizard. The capture software suitable for all ages, any user can, through its tools to capture images of different shapes and easy to edit.

5.Flash 32

Flash32 can be said that all the screenshots software synthesizer, the software provides a screenshot of a variety of ways, the capture operation includes both capture and create animations. There is no doubt, Flash32 feature a rich and powerful, of course, also a relatively complicated set of primary users are likely to lose them and not know why they are recommended for advanced users.

6.Super Capture

This is a screenshot of the software made good, for a screenshot of the software, the most important thing in screenshot function. Super Capture offers many ways to capture, for example, may be the most common full screen capture, it can be the interception of a region, or even irregular polygon area.

7.HotShot

HotShot is a unique tool drawings can capture desktop, active window or selected area, the most value is to copy the results can be sent via E-mail, which allows us to easily share pictures, or different coding area to facilitate interoperability Email.

8.Tyche

Its biggest feature is probably both drawings, pictures and simple image processing functions. It can achieve full-screen, the entire window, the current active window, window work area, the screen any region, fixed region, and the clipboard in the form of drawings. I think one of the best or "any screen area" means that screenshot.

9.Capture Express 2000

Capture Express 2000 is a screen image interception software, which in addition to other images with the same software can intercept interception full screen, window, rectangular area of the screen image, etc., it can also intercept circle, star, square, polygon, etc. various shapes of the region, is a more distinctive software.

10.Print Screen Deluxe

New ideas and a rich feature set at a screenshot of the software new favorite Print Screen Deluxe, which runs on Windows 95/98 platform, its amazing shots functional and attractive, convenient management of amazing.







Recommended links:



Format mkv



matroska video file



My FAVORITE Text Or Document Editors



Super DVD To AVI/VCD/SVCD ripper



Jiangmin RESPONSE to the letter, said attorney Alibaba China lagged far behind the law



mkv file Converter



Ease DVD Ripper



Contract should pay attention to what



pb function library of the International



Recommend E-Mail Tools



evaluation Multimedia Creation Tools



Wizard Icon Tools



Youtube FLV to 3G2 Products



ts file



Firefox FIREFOX go to the fair riding quickly and easily Amoy Baby



Hope AVI to RMVB



SPARK Trilogy: to see how we change the WORLD



Friday, July 2, 2010

AC3 WAVE Maker

AC3 WAVE Maker - Rip audio files from CDs to your hard drive and saving them as WAV and MP3 (including VBR). Record digital audio tracks directly from compact discs without going through your sound card. AC3 WAVE Maker enables you to make high-quality copies of CD music. Retrieve CD information from CD database. Extract audio from avi, mpg, mpeg, wmv, asf, mov files. Convert multiple wma, mp2, mp1, vox, raw, pcm, gsm, adpcm, ogg, mpc, mp+, qt, g721, g726, g723 files to mp3 and wav. Easy-to-use Windows XP theme user interface.
Convert MP3, CD, CDA, CD-R, DVD-Audio, AAC, AC3, ID3, M3U, M4A, M4P, MP3 ID3 Tag, OGG, RA, WAV, WMA, MP2, APE, VQF, MPC, AMR, Midi, WAVE, and RM files on your local network (LAN). Free technical support for registered users. Free upgrades and fixes. Fast LAN scanning engine. Save & export playlist options



Recommand Link:



avchd to MOV



Lohan 3GP Converter



Christmasgift DVD Manager



reviews AUDIO Recorders



HD to iPod Nano conversion tool



video to Archos 7 converter



Christmas-Idea M4V 3GPP2 Encode



File SHARING Or Peer to Peer comments



AlltoDVD VOB To AVI



Games Board REPORT



Video To ZEN X-Fi2



WorldCup AVI To MP4



WorldCup AVI To IPod



Youtube to TV Home



Bluesea Flash to Mobile