Web Forms :: How To Execute An External Url In The Background
Nov 16, 2010i want to execute url such as www.google.com in the background when a button is pressed how do i do that.
View 2 Repliesi want to execute url such as www.google.com in the background when a button is pressed how do i do that.
View 2 RepliesActually I don't know whether my question is related to this thread.
I want to create a web application using ASP.NET MVC 2.
For simplicity, let my scenario be as follows:
A visitor is allowed to submit a text file and get a pdf output from the server.
There is an Adobe-Acrobat-like application, that can convert text to pdf, running on my server.
My question is how to execute the converter such that each visitor submitting files cannot interfere with others?
Should I make an instance of the converter for each visitor?
In my app I am using the open xml sdk to generate a word document and write the file to the response.output stream for the user to download.
At the time that the letter is generated I also need to call a SP via linq data context to update a row in my db.
I think that I need to execute this SP in a seperate thread so that I can simultaneouly write the file to the output. my method looks like this...
protected void btnPrint_Click(object sender, EventArge e)
{
//call sp to update
//create letter and send to client
}
Is this feasible or should I avoid seperate threads?
I'm trying to understand how to execute AJAX animation on an asp button that has to execute code on Postback. In other words, I have button with code behind that needs to be excuted, but at the same time want to be able to have one of animation extenders be applied to it. I understand that I need to use the BeginRequest Event, I'm just not sure how, or which javascript commands to use to call the ajax animation so the postback will still occur.
View 5 RepliesI am looking through a sql stored procedure which I might need to update in the near future. Basically the stored procedure is about 20 lines long. The stored procedure first builds a query
and stores it in a variable named "@Sql". And then for the last two lines of the stored procedure it appears that the big sql statement stored in "@Sql" is executed by using the "EXEC" command. See below. What is confusing though is that the query appears to be exectuted twice? Why was the query written in this way. Don't both lines do the same thing? Why is it being done twice? Could this possibly be a mistake on the
part of the person who wrote the query. Below are the two lines I am talking about?
EXEC sp_executesql @sql
EXEC (@sql)
I need to run the HttpContext.Current.Server.Execute method in my ASP.NET application. This application has a WCF operation that does some processing. Currently, I am to do my processing correctly from within my WCF operation. However, I would like to do this asynchronously.
In an error to attempt this asynchronously, I tried running Server.Execute in the DoWork event handler of a BackgroundWorker. Unfortunately, this throws an error that says
"object reference not set to an instance of an object" The HttpContext element is not null. I checked that. It is some property nested in the HttpContext object that appears to be null. However, I have not been able to identify why this won't work. It happens as soon as I move the processing to the BackgroundWorker thread.
My question is, how can I asynchronously execute the Server.Execute method?
I have query the data from DB using row in array. ow to add external value in between Array ?
Example as below.
oSheet.Cells[4, 3] = + "*" QueryDB.Rows[r].ItemArray[0].ToString() + "*";
We have multiple themes and based on the employee login we need to set the themes. And my themes folder including images, style sheets etc resides outside my application ie inside my master page project.When i refer the theme to it i am receiving an error stating its not valid theme.Cant we refer the external themes and set it page.theme?Any idea on this?
View 5 Replieshow can i create a sitemapnote with an external url like following example?
<siteMapNode url="http://www.myblog.de/" title="smart" roles="*"/>
If i use this, it runs in a 404 error.
I am using an external config file (with MS Enterprise library):
[Code]....
In Global.Config I have a database settings:
[Code]....
But when I am trying to set a roleManager in web.Config:
[Code]....
it writes that can not find MainSqlServer connection string. I am understand why, so the question is - how to make this connection string (from external config file) visible to web.config.
[URL]
I have used this article for routing its working fine but now js and css are not working ... i have used master page.
Depending on a parameter, I want to include html from different files in an aspx page (this is a section of the page). Here is how I am trying to do it:
in aspx file:
[Code]....
in C#
[Code]....
The problem is, whenever I edit the "include" files in VS, VS saves them as UTF-8. Then when I open the web page, there are three extra characters where the included html starts. If I go into a different editor, I can change the format to ANSI and then it displays okay in the web page.
I have two questions: 1. Is there a way I can save the file in VS as ANSI so I don't get the three garbage characters? (I tried saving as file types .htm, .txt, and .inc but none work.) 2. Is there a better way to do this so it does not matter if the file is UTF-8 or ANSI?
I am trying to download an external image and encode it, using the function below.
[code]....
I'm trying to figure out how to save my XML file in the outside location.
I have a Main web app that uses an XML file as a datasource for one of it's pages. This XML file is generated manually by accessing a utuility page in the same app. I created a utility app that resides outside of the Main app ( it's on my C:/Inetpub/wwwroot) but it should save an XML file in the directory of the Main applicatoin. My utility works fine if I need to save to C:/Inetpub/wwwroot/XMLFiles) but I when I try to access the file at the Main application something like that:
objXML.Save(Server.MapPath("../../_MainApp/App_Dev/Marketing/Tests.xml"));
It gives me an error: System.Web.HttpException: Cannot use a leading .. to exit above the top directory. If I just type full URL it says that URI cannot be resolved.. How can I access that Tests.xml file to update it?
I need to essentially make a command line tool available via a web interface. This tool would need to be run ON the web server, not the client machine. e.g.: someCommand.exe -aSwitch param1 param2 The tool will be in a windows integrated auth web app on an intranet. I have not had to do anything like this before, so I want to find out how others handle this, what is the recommended best practice? a quick google first showed someone using system.diagnostic.process... so to start playing I did something like this, just to see if it works, it does:
[Code]....
I won't be running cmd.exe, that's just to test with. The actual command line tool I will be using is not on my dev machince right now. . is using system.diagnostics.process, processStartInfo, and start method acceptable? my goals:
1. use recommended best practices, especially with regard to security
2. I'd like to start the command, and use ajax to display the commands output as it runs, and of course I need to know if it was successfull or not.
I need to display html text (terms & conditions) on a page. This text comes from an external html file. The reason for this is so the text can be changed as and when needed in the external html file and web page would display the up to date text. Also html will also handle text formatting.
So my question is how can I import html text from an external file and display on a web page?
We need assistance with a portion of a major web application project scheduled to begin user testing within 10 days. The troublesome part of the code calls an external application when a button is clicked in Web page. When run from a command prompt or bat file, the external application, App.exe, runs perfectly producing the desired result. We created a test page and a small console application, Con.exe, to test the button code with a known quantity. The test application runs perfectly when the button in the Web page is clicked. However when we change the code to run App.exe instead of Con.exe, the App.exe code will not execute. We even tried creating a bat file to execute App.exe. Like the exe, the bat file executes from the command prompt or when double-clicked,but fails to run when called as a process from the button click event. Can anyone assist us? Here is the C# code: (.Net 3.5 sp1)
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Diagnostics;
namespace WebButtonTest
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
protected void Timer1_Tick(object sender, EventArgs e)
{
int checkNumber = 0;
if (Session["checkNumber"] != null).......
[Code....]
I need to access controls of aspx page and usercontrol page through the external .js file. I created a global varaible in the aspx page
<script language="javascript" type="text/javascript">
var loadPanelID = "<%=ajaxLoadingPanel.ClientID%>";
</script>
Now I pass this value in the onclick event of button click (Let the funtion name be Fun(loadPanelID) ) . The controls is recognised in the .js file. Everything is fine till now. Now i need to call the same javascript method Fun() from the button click of usercontrol.
<script language="javascript" type="text/javascript">
var loadPanelID = "<%=ajaxLoadingPanel1.ClientID%>";
</script>
I have ajaxLoadingPanel1 in the usercontrol and I have defined global variable as in the first one in ascx and passed that value to Fun() method. But this time it gives error called "loadpanelID" is undefined.
I have a master page in my website. I want some sort of container to load external website in my contentplaceholder.Frames and object tags are the tried options. My DOC type doesn't support Frames and object tag has that scroll border displayed by default and I can't remove it because it will be a page from another domain.
On the loaded site the users will be able to browse and search products, so I just dont want to read the html once. That will be the actual website loaded/displayed.
What would be the most efficient way to inject just the contents of an html page into a user control or directly into a page?
In example if the html page I'm calling consists of a simple <div> layout how could I display that within an aspx page.
My external javascript file named "messages.js" located in the "/scripts" directory:
[Code]....
How do I call this function from my codebehind? I need to register it through the client script manager right? Can someone provide me the call as I'm not sure how to add the function through an external file using type="text/javascript"
I'm migrating an old ColdFusion site to ASP.NET. One of the pages has a form that posts to an external URL.
[Code]....
I just discovered that you can't do this in an .aspx page. Seems the page will just post to itself if you hit the submit button.What's the proper technique for achieving this in ASP.NET? There are a couple of hidden fields that pass parameters to the external URL.
I have a registration form. Settings of this form, like which fields are required I get via webservice. So I need programatically validate this form. I decided to create variable count of requiered field validators in Submit click. The validator is created in external object that holds a field settings.
[Code]....
I tried to debug it and GetValidator() created RequiredFieldValidator, but in btnSubmitRegistration_Click after that, validator was null. Object lost it's reference. Where is the problem?
there are a form in a page like this :
[URL]
how we can request that form dynamically and make it in my webform ?
I programmed a WebForm where I can add dinamic FileUpload elements and upload a variable number of files. So far no problem.
My problem begins when I try to automate this process in a class Uploader (external to this webform so it can be called from any other form or module). In my form's Page_Load() I instantiate this class and call the method uploader.layout(Me), which definition you can see next:
[Code]....
I get an error
El control 'FicheroUpload1' de tipo 'FileUpload' debe colocarse dentro de una etiqueta de formulario con runat=server. Which means something like The control 'FicheroUpload1' of type 'FileUpload' must be set inside a form label with runat=server.
Where is the error? Can I insert dinamic elements in a form from an external function, such as this class method?