Clipboard in .Net VB.NET web forms - asp.net

How to copy a text in asp.net page into Clipboard using vb.net code-behind ?
And what libraries to import ?

You can't copy text into clipboard from serverside because client's memory belongs to the client. You must use javascript for this purpose and that's browser dependent.
Here is a SO-link that'll help you to get started: how-to-copy-to-clipboard-in-javascript
They recommend to use zeroclipboard, i have no experiences with it.
Here is another SO-link with a simple example: how-to-actually-use-zeroclipboard-in-jquery
What you can do from serverside is to register a client script-block that will be executed on load of your webform to copy the text into clipboard as soon as possible.

Related

Creating a "web service" using ASP.net - what's in the DLL?

All,
Sorry in advance - I'm a total novice when it comes to ASP.net.
I'm working on a project that's fairly simple. I have single HTML page that collects input from the user. When the input is complete - the html page uses AJAX to post the data to a web service. That service receives the data, does some processing on it, then sends back a response.
The "client" part of this app is pure HTML/Javascript (not ASP.net), and is complete and works perfectly.
The "service" part of this app (MyHandler.ashx) is built using ASP.net. Technically - what it does is receive data from the AJAX post. It then uses Microsoft.Office.Interop.Excel to open an Excel spreadsheet, pass the users' inputs into that spreadsheet, then retrieve several calculated values from the spreadsheet, and returns those values in the response to the AJAX post.
Using Visual Studio VS I've got this whole process running locally on my PC.
When I "publish" the project - VS creates a ton of files. I sent those files to the team that manages the server; they deployed them, and voilà - it works. (The necessary Office interop libraries are installed on the server).
So - my question - as I make a few modest changes (e.g., validation, error handling) to the handler - MyHandler.ashx - which of those published files actually change? If i want to reploy - do I simply need to resend an updated version of MyHandler.ashx? Or, do simple coding changes to that file require changes to the DLL?
I guess my question is, generally - what's in the DLL? (E.g., is it a compiled version of MyHandler.ashx?)
More specifically - publishing my project creates the following files that I don't really understand:
Web.config
Global.asax (in my project, there's not much in here)
bin/MyProject.dll
So, if I make changes to MyHandler.ashx - can I simply reploy THAT file? Or, do I need to "publish", then "redeploy" thd dll? (By changes - I mean simple code changes, not decisions to include/exclude other external dependencies).
Sorry - this question must seem like nonsense to knowledgeable ASP.net developers. But, with other technologies I've used, things were clear:
If you're developing a Flash project, you write source code in .FLA files, then compile, then deploy the resulting .SWF files.
If you're developing an HTML/JavaScript/PHP project, you write those files, then deploy those same files
I'd trying to get a better understanding of what's what with ASP.net.
Thanks again.
The DLL contains the compiled code behind the ASHX file. The ASHX is just a service definition for an HTTP handler. When you make changes to the service (e.g. the code), simply issue another Publish like you did before and send the entire package.
But in short, when you change the code, the DLL is what's changing.

Connecting Flash Programming SWF file in asp.net and need to store some values in data

I am having some doubts in flash , asp.net and SQL or any database connectivity :
First i have created a swf flash program with some text box and button
Second, if i click that button means it will need to save in database
Third, how to connect the created swf file in asp.net and in database also.
Any ideas how to solve this?
In short: all the steps that you have described do sum up on a concept of passing data between flash swf and asp.net. There are plenty of references that you may use, however, here you are some good posts to follow:
Pass Values Between Flash and Asp.net
Thread: Passing variables to Flash
Passing variables from asp.net to flash
Passing FlashVars from C# to run swf in a player

ASP.NET Sound Resource not publishing

So I created an ASP.NET 4 application in VS2010, that needs to play sound to the end user, and it is working perfectly in my local development environment. The problem is the sound resource nor the Resources.resx is not being published to the server. Any idea why?
What I did:
1) Under Project  Properties  Recources I added my sound resource called: soundbyte (containing soundbyte.wav). I noticed this creates a Resource folder with the wav file and under my project a Resources.resx file referencing the file
2) In my code I play the file as follows:
Dim audioFile = My.Resources. soundbyte
Dim player = New Media.SoundPlayer(audioFile)
player.Load()
player.Play()
In the Visual Studio Solution Explorer right-click on Resources.resx and select Properties. Build Action. Set to content.
EDIT: The following resource might also help.
http://blog.andreloker.de/post/2010/07/02/Visual-Studio-default-build-action-for-non-default-file-types.aspx
Ultimately, I found a way to play the sound to the client browser (as opposed to the server the asp app is running on) was to follow the techniques in this example: http://www.vbdotnetheaven.com/UploadFile/scottlysle/PlaySoundsInASPX09032006083212AM/PlaySoundsInASPX.aspx
But I found an even better way in my case was to use Javascript, which doesnt' require the Resources technique.
simply embed the sound on the page after the tag:
<embed src="Sounds/jump.wav" autostart=false width=1 height=1 id="sound1" enablejavascript="true">
Then in javascript setup the function:
function EvalSound(soundobj) {
var thissound=document.getElementById(soundobj);
thissound.Play();
}
Finally play the sound in the browser as needed in Javascript:
EvalSound('sound1');

Can I run vb script from C# application ?

Can I run vb script from C# application.Can anybody provide me vb script with exam
like on button click show message,if perticular panel is visible.
i don't think you can run vb script code inside c# code, but this How to call a VBScript file in a C# application?
could do the job
You can't execute VBScript directly in the same C# process, but you can execute it through a separate process using the Process class.
Process.Start("path to vbscript", "arguments if any");
If you are talking about client side on a browser, then this can only work on IE (the only browser that supports vbscript).

Export to PDF to a local folder

I have a Asp.net C# windows application where i call a SSRS Report.I want a functionality called " Export to pdf" in my page,and the following pdf must save into a local folder.Is it possible through coding or some other way.
use WkHtml
or itextSharp for better performance in open source projects.
Yes, but if you are using SOAP to access the report server, you need to build it up yourself. If you are using the report viewer controls or URL access, this functionality should already exist.

Resources