|
Hi..
how can i load word document to iframe.. specially when the document is on my c:\assignment folder and not in the website root.
what will be the src value;
thanks
By:
Hemant Thaker
|
|
|
|
|
What do you mean?? Are you going to download the word file.
If you want to show the content of the Word File, it wont be possible. You need to read the word document using Word Interop services and then create HTML document based on it and then show the html content to the IFrame.
If you want to transmit the file just create an HTTPHandler and call the handler from the src and within the processRequest place a
Response.clear();
Response.TransmitFile(@"c:\assignment folder\yourfile.doc")
Response.close();
But in such a case the file will be downloaded from the IFrame.
|
|
|
|
|
Hi..
I get the path of this word document and just want to display it in iframe
privided that it's in c:\somefolder\xyz.doc
dont want to download it..
what will i set as src property of iframe... (the path)
thanks
By:
Hemant Thaker
|
|
|
|
|
|
Does it works in browsers other than IE. Actually this is an MHT solution... Only IE can open MHT i guess...
Other browsers might download the mht docoment ...
|
|
|
|
|
No idea. Let me read that one .
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Hi...
I just want to load .doc file into iframe...
this .doc file is not the part of my website,,, its not anywhere in root directory... but somewhere in c:\somedirectory\.....
(outside of my project)..
what should i put in "src" attribute of iframe.
i m accessing iframe from codebehind file.
iframe.attributes["src"] = "????????????????????";
thanks
By:
Hemant Thaker
|
|
|
|
|
No. You cant set src property of IFrame if the folder is not within a valid virtual path. To do this, you need to create a HttpHandler.
Say you write
<iframe src="WordResource.axd?id=xxx">
Now create a class WordResource and implement from IHttpHandler
in ProcessRequest method place
string id = context.Request.QueryString["id"];
context.Response.TransmitFile("yourfilepath");
Now place the definition of WordResource.axd in your web.config
|
|
|
|
|
Yes.. I have tested the Demo application. The solution is really of no use.
Its title should be "Creating your First Server Side Custom Control".
Even the Server side control just creates an IFrame and places the mht in its source. Thus it is shown in IE properly, but not in mozilla or other browser.
I think the only solution to this should be to read the entire word content from server and generate an equivalent HTML... with proper CSS and all.
|
|
|
|
|
hello all
i am using asp.net with crystal report in my project.
when i load report null is not null exception occured.
it works fine on my development machine ,testing server
but when i upload it to webserver it throws javasricpt exception
null cannot be null message box.
i have done lots of googling but i cannot find any
solution. Plz help me
|
|
|
|
|
When you are getting this error ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
This is the patent NullReference error that comes to the browser.
There might happen when a script is loaded which might be calling a control before actually its been rendered in the document.
Thus it is always recommended to place a script either in an event.. if not any control event, use document.onload or place it below body tag.
In your case, I think the html output is not rendered properly. Make sure that Crystal Report dlls are properly installed in the web server and has access to them.
|
|
|
|
|
Hello,
I am Vikash Gohil.
I have a Query related to DLL files Usage in my Web Application.
I have a USB Device which reads Smart Cards and Stores Data from these cards in its memory.
Using a Windows Application which uses a DLL file, I can retrieve Data from that USB Device.
The DLL files have functions for Accessing/Controlling the USB Device.
Now I want the same functionality from a Web-Application.
ie, the WebApp will be run in Intranet environment with the App loaded on WebServer.
Now where do I need to put the Device DLL files that my Code uses for Controlling Device.
The Device is Connected to a USB port on Client PC.
So How can access the USB device on client PC, from Web browser running my web app.
Please Help me, I am a Newbee in Web Development.
Please Any help would be greatly appreciated.
Thanks In aDvance
|
|
|
|
|
|
Well Sorry for opening a new post,
Actually Abhishek, the earlier post was for devices Connected in LAN and this one is for Accessing a USB Device on Client PC,
might be the Subjects are same, sorry.
So any idea how can I access a USB device using it's DLL that is connected to Client PC from Browser.
The Client PC has all the necessary drivers and DLL files installed required to use the device.
Any Idea from anyone.
|
|
|
|
|
Hey... no big deal.. You can open as many post you want. The question should be different.
On this matter, I would like to say if you want to access your usb device from client pc without any driver installed.. it wont be done. Through website you can only transfer base64 data which has some limits.
You can make a browser plugin I guess... if you require this... provided the clients should download your plugin and install it to their machine.
I hope you got the problem clearly.
Cheers.
|
|
|
|
|
Hello, Abhishek.
Thanks for your reply.
Actually I would have everything Installed on Client PC ie, the Drivers for USB Device and Even my DLL file registered on Client PC.
Any way I was just thinking whether this Could be done through VBScript.
I have written a DLL file in which there are functions that Uses the Main DLL file.
I have registered the DLL on My PC. Also written a VBScript. But the Script is not working properly.
When Calling the function from a Windows App, gives me proper output.
But when run from VB script gives me improper results.
There are not errors, but results are not as expected.
Can you tell me why this Mismatch, when run from VB App runs perfectly OK, and on the same machine run using VBScript wrong results.
Also abhishek, you were talking about Plugins, could you give me more information on that, like how to use it, create it etc. Would be of great help, I had come to know of plugins but have no idea how to go about it.
Please any help would be great.
|
|
|
|
|
As VBscript doesnt work in browsers other than IE, it would be bad to do programming in VBscript.
And hey, if you are to install all the drivers in cleint pc why do you need to make use of browser. Why dont you use Windows program to do this job.
The web environment is only for those who are in remote areas and doesnt need to install any software.
You can use Windows application and use Remoting / WCF / Web service to communicate with the server as well.
|
|
|
|
|
Thanks Abhishek for your reply.
Well, Abhishek, you are right but it's a Clients requirement that the application should be Web-Based.
Also we are going for it bcoz in todays world everything is bcoming web-based, so it's necessary to be with the world other wise your competitors would leave u behind.
OK now back to the topic. See I have successfully written a VBscript to access a Card reader on clients PC using browser.
Now I have another query.
I have another USB device. To use this device, the manufacturer has provided a .OCX file.
So in windows app, I register my OCX and I can see a control in the ToolBox which I drop on a Form and use the USB device using this Control.
Now this Control works on Events and the USB device is a FingerPrint Reader.
When I place my Finger on the Reader it generates an Event which is Captured by my Windows App(bcoz of OCX Control on the Form) and I get the FingerPrint Data.
Now How Can I Achieve this in VBScript in my Web-Page.
Hope you understand my explaination.
Any Ideas.
|
|
|
|
|
Hello!
We run this code to get xml for an example from uri´s
<br />
try<br />
{<br />
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(requestUriString);<br />
<br />
webRequest.Timeout = timeOut;<br />
<br />
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();<br />
<br />
return new StreamReader(webResponse.GetResponseStream(), encoding);<br />
}<br />
catch(WebException e)<br />
{<br />
LogError(e);<br />
return null;<br />
}<br />
<br />
We keep getting alot of "The operation has timed-out"-exceptions thrown. Is there something we are missing when we are setting up the webRequest object? For instance, should we set ReadWriteTimeout?
/regards
W
|
|
|
|
|
|
Where you mentioned webRequest.Method
Other than that the code seems to be alright. If still errors out, open a web browser, paste the requestUriString to the address bar and see if the page response is within the Timeout limit...
Cheers
|
|
|
|
|
Thank you both for your responses! I will try your suggestions.
|
|
|
|
|
Hi
I have one dropdown contain status information.
Status are
1. Finished
2. Open
3. Progress
Also one date textbox.
I want to set the text box is editable and mandatory when i select the status as finished in the dropdown. Otherwise it should accept null values(not mandatory) and read only.
Can any one help me please. its urgent. It should be in C# or java script
Regards
K7
kesavan
|
|
|
|
|
I would have a requiredfieldvaliadtor on the textbox (and perhaps a regularexpressionvalidator too to ensure a date is entered) but set enabled to false. Then, when the user selects "FInished" from the dropdown, enable the validators.
|
|
|
|