Hi, I have a small HTML with a button and a handler object which is likely to catch the button's onclick event. When I try to click the button it says "this.button.id is null or not an object". If I do onclick="objHelper.buttonClick" in the "input type=button" tag instead it works fine. What is the right solution? Here is my code: function helper() { var button; this.setButton = function(tobjButton) { this.button = tobjButton; this.button.onclick = this.buttonClick; }; this.buttonClick = function() { alert(this.button.id); }; } var objHelper = new helper(); function init() { objHelper.setButton(document.all("btnButton")); } Thanks: (K)
izotov
Posts
-
javascript events -
CompileAssemblyFromSourceI am sure becouse when I get to this line while debugging: Results = CProvider.CreateCompiler.CompileAssemblyFromSource(CParams, Source) I examine CParams.OutputAssembly property, and it is the same as the name of the assembly not found. For example when I get >>Could not find file "C:\DOCUME~1\KARESZ\ASPNET~1.KAR\LOCALS~1\Temp\svzrojnc.dll"<< CParams.OutputAssembly value is "C:\DOCUME~1\KARESZ\ASPNET~1.KAR\LOCALS~1\Temp\svzrojnc.dll" as well. So I think the framework cannot create that file for some reason. Any other ideas? (K)
-
CompileAssemblyFromSourceHi I have a class which makes runtime compilation. When I use it in a WinForms application it works fine but when I use it in an ASP.NET Page I allways get a "Could not find file" error. Here is a sample: Dim CParams As New CompilerParameters() Dim CProvider As New Microsoft.VisualBasic.VBCodeProvider() With CParams .GenerateExecutable = False .GenerateInMemory = True .IncludeDebugInformation = False .TreatWarningsAsErrors = False End With Results = CProvider.CreateCompiler.CompileAssemblyFromSource(CParams, Source) (Source contains the source code of the assembly to create) When calling lobjCProvider.CreateCompiler.CompileAssemblyFromSource I get >>Could not find file "C:\DOCUME~1\KARESZ\ASPNET~1.KAR\LOCALS~1\Temp\svzrojnc.dll"<<. "C:\DOCUME~1\KARESZ\ASPNET~1.KAR\LOCALS~1\Temp" is the temporary folder for ASPNET user account. Is this a permission problem? I tried to grant Everyone Full controll on this folder but still not work. Thanks! (K)
-
ASP.NET _2 Web directories?Hi, We work with solutions containing ASP.NET projects under Source Safe. In the .sln file the webproject's path is allways changed from http://localhost/WebFolder/WebProject.vbproj to http://localhost/WebFolder\_2/WebProject.vbproj somehow. From this point when my crewmemebers open the solution the web project is unreacheable (gray). When I get latest version I can open the web project again although the sln file is changed here as well. We have got to edit the solution file and undo these changes. Is there a way to eliminate this problem? Thanks! (K)
-
Date formatI would like to write hungarian style formatted dates to response. The hungarian short date format is "yyyy.MM.dd.". I have tried the following settings: Session.LCID = 1038 or Thread.CurrentThread.CurrentCulture = New CultureInfo(1038) Thread.CurrentThread.CurrentUICulture = New CultureInfo(1038) (1038 is the hungarian locale ID). The result is allways the same, the displayed date format is "M.d.yyyy" (which seems to be the general date format). If I write a Windows application instead of web application the date formatting is correct again... Any idea? Thanks! (K)
-
PDF uploadI have finally found it: in the Web.config, or in the Machine.config I had to set . :) (K)
-
PDF uploadWell I have tested it on a quite small PDF and it works. It seems you are right. How can I make my server accept big files? (If there is a way...) It seems to me that there is no exception but the whole request is not handled, it doesn't reach the server code becouse I think the request is blocked when there is a big file to upload. (K)
-
Getting Current Aspx pageHave you already tried Request.FilePath? Of course you have to process the text returned by this property. For example: Right(Request.FilePath, Request.FilePath.Length - InStrRev(Request.FilePath, "/")) (K)
-
PDF uploadI try to use HTML element to upload files from web clients to server. It works very well except when I select a PDF file and submit the form containing the then I get to "The page cannot be displayed" error page. I have tried several file formats: GIF, JPG, DOC, TIFF ..., with these there are no problem only when I try to upload a PDF. (K)
-
AppDomainI try to log what's going on in my web application in separate logfiles named by the session ID. The logging is done by a common object which is defined in a dll referenced by the web application. The problem is that when there are two (or more) paralell sessions running they will have different log files but log will be written in the log file created later. That is because these sessions run in the same AppDomain that's why logging object is the same and it's LogPath is allways set by the session launched later. Is it possible to set up the system (IIS for example) to run different sessions in different AppDomains?
-
ASP.NET & UNCThe problem is that when you want to reach a remote resource from ASP.NET the ASPNET account should have extra permissions. (The account under Administative Tools --> Internet Information Services --> Properties --> Directory Security Tab is responsible for IIS and not for aspnet_wp.exe which will execute our function.) That is why I had to replace ASPNET account for aspnet_wp to a domain wide one, give her the sufficient privileges and rights to the local and remote resources. Now the domain account has rights to see anything allowed in the domain, and the function call can be performed on the UNC shared file. Scenario: 1. create a new domain account 2. on the IIS machine assign to it logon as batch job logon as service privileges 3. assign to it NTFS permissions on the IIS and on the UNC sharing machine 4. in machine.config's ser userName and password according to your new domain account Detailed information on replacing aspnet_wp's account: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT01.asp (K)
-
ASP.NET & UNCI have an ASP.NET project, which should execute a command (calling Shell() function) on files are shared via UNC. The web server (IIS) and the file server are in the same domain. I have created a domain user, which has rights to read the shared directory on the file server, log on as batch job and log on as service grants on the IIS server and set this user as the anonymus access user under the IIS MMC for the application. And it can not reach the shared files. What is wrong? What is the solution to reach UNC shares from an ASP.NET application? (K)
-
VB.NET overloading & COMHi, I'm working on a VB.NET project and my objects should be reachable using COM. My problem is that these objects have overloaded methods, properties, which seems problematic. For example I have a collection class with two item properties:
Default Public ReadOnly Property Item(ByVal Key As String) As Object
andDefault Public ReadOnly Property Item(ByVal Index As Integer) As Object
When I try to use an object of this class in a COM only environment - like MS Word - there only one Item can be seen, and allways the first. So using the order above I can query collection items only by Key, when I change the order I can query only by Index. This problem does not occour under .NET. My question is: how to do VB.NET overriding, polymorphism to satisfy COM requirements? (K) -
COM & VB.NET overloadingHi, I'm working on a VB.NET project and my objects should be reachable using COM. My problem is that these objects have overloaded methods, properties, which seems problematic. For example I have a collection class with two item properties:
Default Public ReadOnly Property Item(ByVal Key As String) As Object
andDefault Public ReadOnly Property Item(ByVal Index As Integer) As Object
When I try to use an object of this class in a COM only environment - like MS Word - there only one Item can be seen, and allways the first. So using the order above I can query collection items only by Key, when I change the order I can query only by Index. This problem does not occour under .NET. My question is: how to do VB.NET overriding, polymorphism to satisfy COM requirements? (K) (K)