amma.NETtami

.NET walkabout
posts - 11, comments - 18, trackbacks - 0

agosto 2007 Blog Posts

Running custom VbScript code from asp

Running custom VbScript code from asp I was in the need to run some custom VbScript code from an asp page, so I went through the problem and found a very simple solution. A common solution is to use the Microsoft ScriptControl. Here is a very simple example running a piece of code stored in a text file. default.asp <%@language=VBSCRIPT%> <% dim sFile : sFile = "" sFile = LoadFile("MyCustomScript.txt") if len(sFile) > 0 then     Response.Write "The result is: " & ExecScript(sFile) end if Function ExecScript(sScript)         dim sc         'Create the Script Control object         set sc = server.CreateObject("scriptcontrol")                 sc.Language = "VBSCRIPT"         sc.UseSafeSubset = false         sc.Reset                 'add the custom script to...

posted @ lunedì 27 agosto 2007 21:25 | Feedback (3) | Filed Under [ ASP VbScript ]

ShowModalDialog and ASP.NET postback

Whenever you use a postback in a modal window, magically Internet Explorer fires the event in a new page. To avoid Internet Explorer to act like that, just add... <base target="_self" /> ... wherever you want, just before the HTML Tag or simply in between the HEAD tag of your HTML page.

posted @ mercoledì 22 agosto 2007 18:28 | Feedback (1) | Filed Under [ ASP.NET ShowModalDialog ]

Powered by:
Powered By Subtext Powered By ASP.NET