|
If the form just sends the filename of the file, you just have to send the filename, not the file data.
If the form on the other hand contains an upload field, that's a completely different thing. Then the form data is not url-encoded as usual, instead it's in multipart format, and the file data is one of the parts.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
Ok I am currently in the phase of transforming an application fromn classic asp to .net. However its going to be phased so we currently have the set up below:
ClassicAspPage ---> iframe ----> aspx Page
I have written a javascript function that automatically resizes the iframe according to the content of the page loaded, this is done on the OnLoad event of the iframe by calling window.parent.autoIframeResize(iframeId) and it works brilliantly.
However what I need to do is call this from within the aspx page as whats happening is the page changes according to options or validators, and the page currently gets cut off in the iframe as it grows too large. I need to call the resize function on those options or when the page validates so it resizes the frame again to fit the content.
How would I bubble up to the javascipt function that is on the Classic ASP page?
I have tried:
window.top.autoIframeResize(iframeId)
window.parent.parent.autoIframeResize(iframeId)
but have had no luck so far, if anyone could help that would be great
Regards
Paul
|
|
|
|
|
oceanexplorer wrote: I have written a javascript function that automatically resizes the iframe according to the content of the page loaded
oceanexplorer wrote: However what I need to do is call this from within the aspx page
ummmm aspx runs on the "server"
|
|
|
|
|
Well yes it does but you can also have client side functionality on an aspx page,and all I need is to be able to call a javascript function that resides on the ClassicAsp page that resizes the fram according to the currently loaded content.
|
|
|
|
|
I am still not sure what you are saying. You cannot call a client side javascript from aspx code running on the server.
|
|
|
|
|
Ok I'll explain a little more.
I currently have a javascript funtion that on the OnLoad event of the iframe automatically resizes an iframe sat in a ClassicASP page according to the content that is loaded into the iframe.
The iframe is rendering ASPX pages.
What I need to do in the ASPX page is call the Javascript function from a imagebutton using the OnClientClick event, this event allows a Client side event to fired on an asp control.
The reason I want to do this, is for example, I try to click next but the client side validators and validatesummary prevent the page in the iframe from going forward, lots of error messages appear in the validation summary, this pushes the content in the iframe down and off the frame, what i need to do is to get the iframe to resize itself according to the new content. So I need to call the javascript function that I created, but I have no idea how to access it from the ASPX page, i.e. bubble up from the ASPX page to the iframe, to the classic ASP page where the javascipt function resides.
Hope that explains a little better
Paul
What
|
|
|
|
|
oceanexplorer wrote: What I need to do in the ASPX page is call the Javascript function from a imagebutton using the OnClientClick event, this event allows a Client side event to fired on an asp control.
If you mean a button in the html inside the IFrame then you need to do what is called "cross frame scripting".
oceanexplorer wrote: how to access it from the ASPX page, i.e. bubble up from the ASPX page to the iframe, to the classic ASP page where the javascipt function resides.
you need to stop saying that. It is very confusing. In the browser there is no ASP or ASPX just HTML and Javascript. As stated above, if I understand you correctly, you need to look into cross frame scripting tips on the net[^].
|
|
|
|
|
Hi Mike,
Thanks for all your help it is much appreciated. I actually need to use cross fram scripting in another section. I'm not entirely sure its what I need as all I am trying to do is access Javascript function in the container page of an iframe.
Sorry to use ASPX & ASP terminolgy, that is how I refer to them as they are technically ASPX pages (or ASP) not pure HTML (.htm), just it contains HTML, Javascript and a reference to the Codebehind file (i.e .CS). But I can understand why its confusing as you are refering to ASPX being purely the server side code section, but thats actually known as the Codebehind file. Anyway I digress.
Thanks for your help, most appreicated.
Paul
|
|
|
|
|
oceanexplorer wrote: I'm not entirely sure its what I need as all I am trying to do is access Javascript function in the container page of an iframe.
Have I understood you? From an event inside the IFrame Page yes? That is why it is crossframe scripting. The "container" of an IFrame is a Frame, see, two different frames and therefore crossframe scripting.
oceanexplorer wrote: they are technically ASPX pages (or ASP) not pure HTML
Not when they are in the browser, then it is pure HTML, CSS and Javascript and some XML. The browser does not know anything about ASP or JSP or ASPX or Ruby or Python or any other server side technology.
oceanexplorer wrote: but thats actually known as the Codebehind file. Anyway I digress.
Not at all. Since I only started doing web development in 1994 using C on Unix and Apache I am new to it and could use a few pointers. [that was sarcasm]. You can do an entire page in a .ASPX file without any codebehind file so your statement is ... well wrong. ASPX "is" server side technology, period.
|
|
|
|
|
Ok I stand corrected Thanks for all your help, not had chance to try the cross frame scripting as have been away for a few days.
Regards
Paul
|
|
|
|
|
Hi,
Can any one suggest any good CSS designed sites, I mean very good sites. www.windowsmarketplace.com is my favourite CSS designed site. www.elance.com also looks good.
Regards
ma se
|
|
|
|
|
|
Hi guys
This is a general question which I hope you can help me with. I'm not really into ASP 3.0 that much, but in this case im forced to use it
Anyways ... I have a backend component (a DLL) written in C#, which contains methods needed in the ASP frontend.
My question is... How do I access my DLL from the ASP code? Is it even possible?
Examples would be much appreciated!
/Thomas
|
|
|
|
|
1) Register your dll.
2) use Server.CreateObject(Name of dll) to create an object.
Dim s
set s=server.createobject("XXX") where XXX is your dll
now you can use the properties and method defined in your dll. like
s.XYZ
s.PPP
vikash
|
|
|
|
|
There's a lot more to exposing your object than just registering it. In order to do this, a COM compatible tlb has to be created and registered. There's a project property called "Register for COM Interop" that can be used to automatically manage this.
This[^] article gives more details on what you need to do to your code to use it properly through COM/COM+.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi Pete
Thanks for the link to the article. Works perfectly!
|
|
|
|
|
No problem. Glad to help.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi Vikash
Thanks a lot for the example! It works perfectly!
Have a nice day!
/Thomas
|
|
|
|
|
|
Hi..
Im using IFrame as my body in my aspx page to generate Emails. To edit IFrame i just wrote the following code in Javascript..
IFrame1.document.designMode="On";
After this line is executed the Iframe is editable and i can type any text inside iframe.
Now Im using VBScript to create a word application as an object for spell checking. In this case I need to pass the Text of the iframe as a parameter value to VBScript funtion i wrote.
The issue is i cant get the Value or text inside the IFrame using VBScript.
i wrote the above code in VBScript Function but it is not getting the text inside the iframe.
set Ctrl = document.getElementById("IFrame1")
MsgBox(Ctrl.innerText)
How to get the value or innertext of the iframe using vbscript or the other way is how can i create a word as an object and using that object how can i spell check in Javascript?
pl. help me in this issue. im working for this for the past 1 week. its urgent.
Thanks in advance
Selvaganesh.G
|
|
|
|
|
I believe that you can do this by using the frames collection. Here's how (assuming that your frame has an id of IFrame1):
alert(document.frames("IFrame1").document.forms("Form1").elements("myTextBox").value)
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Thanks For your Immediate Responce.
But i ll tell u my clear cut Scenario.I just want the inner text that i wrote inside the IFrame. (i,e)I just made the IFrame itself as a Text Editor by giving IFrame1.DesignerMode="On". I can simply type anything inside the IFrame.
The Issue is I cannot Retrive the text what i typed Inside the Iframe Using "VBScript". In javascript i retrived the innertext by using the following code successfully..
IFrame1.document.body.innerText
But I need the Code in VBScript. what u gave is a Javascript code.
and one more issue is, u gave alert(document.frames("IFrame").document.forms("Form1").....)
But since im using Content page which is created from the Master page, i dont have the Form id value for my page i use..so i cant use like document.forms("Form1")..something like tat.
please help in this issue..
Selvaganesh.G
|
|
|
|
|
Please reply me.. im waiting for your kind reply
Thanks in advance..
Selvaganesh.G
|
|
|
|
|
I tried the VB board but maybe I'll have better luck here.
I want to write a windows service application that reads a web page. That web page requires that the client can process javascript.
Has anyone successfully implemented Javascript with System.Net.WebClient?
I tried the code from the article "A simple .NET based WebClient with JavaScript support" but that code crashes with an inner JScriptException. Its acknowledged by the author and it looks like the trail ends there. According to microsoft the Microsoft.JScript.Vsa.VsaEngine used in that project is deprecated.
What is the current working solution for processing webpages in code?
This is what my code looks like. The web page at the URL I am calling uses javascript to set a cookie in order to prove that Javascript is running. It doesn't look like this code can do it. I can set cookies in advance but I can't seem to duplicate the javascipt setting a cookie. Help!
Dim webClient As Net.WebClient = New System.Net.WebClient
webClient.Credentials = System.Net.CredentialCache.DefaultCredentials
webClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705")
webClient.Headers.Add(Net.HttpRequestHeader.Cookie, "aCookie:aCokievalue")
Try
Dim data As Stream = webClient.OpenRead(sURL)
Dim reader As New StreamReader(data)
Dim s As String = reader.ReadToEnd()
'response = webClient.DownloadData(sURL)
'Return Encoding.ASCII.GetString(response)
Return s
Catch ex As Exception
Return ""
End Try
|
|
|
|
|
Could you use the JScriptCodeProvider[^] class for this?
Deja View - the feeling that you've seen this post before.
|
|
|
|