Web Forms :: Saving XML File At The External Application?

Apr 7, 2010

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?

View 6 Replies


Similar Messages:

Saving A Text File To The Application Folder?

Jun 22, 2010

i have build an MSI file for my project. Now what i need i am having some text boxes on my form. If i click on save i would like to save it as text file to the application installed folder.

View 3 Replies

Web Forms :: Sending Scheduled EMail From Web Application As External Service?

Dec 27, 2010

As indicated in the Subject, I have a web application (say APP) that should feature an e-Mail Notification Service (ENS). Activation of the Service is controlled by a Button in a dedicated page where some parameters are also included to set running Period (FromTime - ToTime), Interval, Recipients, etc.

When said button is clicked, it should maintain those parameters into database then launch ENS. Since ENS is expected to run for good according to set parameters, it logically should run as an external application/service, independent from APP.

When ENS starts, it needs to consult database to fetch parameters, then schedules its Timer to periodically check database for some transactions that when found, should trigger ENS to dispatch e-Mails to concerned Recipient(s).

CHALLENGES:

1. Launch ENS as an external application on button click from APP.Achieved by using System.Diagnostics.Process class. However, I encountered a problem in verifying if the process is already running before starting it. The root of the problem lies in
ProcessName property. Since ALL web applications must be launched via IE, hence, have
iexplore as their ProcessName, which is also applicable to all processes started through IE, it is very likely to have multiple processes utilising IE. How to check which is which? I couldn't figure out that.

Eventually, I ended up with a workaround: when the Process is started from APP, capture its ID and save it to database, then use this ID with GetProcessById() method for later verification. When the Process is terminated, reset stored ID in database.

2. What sort of application should ENS be: Windows Application or Web Application?

In either way however, ENS will always run invisible in the background being a Process. If this is the case, how about creating it as a Windows Service instead?

I did a lot of reading but still confused. However, the choice is limited now to either Web Application or Windows Service. Which one is more convenient to the task in hand?

3. What Timer to use?

I tried System.Timers.Timer in a test web application but it didn't fire! Then I used ASP AJAX Timer and it worked pretty well (I still need though to try running it from APP to judge its functionality). I came across some recommendations to use System.Threading.Timer but haven't tested that yet. Would it worth the trial?

4. ENS as a Windows Service.

If I create ENS as a Windows Service, would I be able to communicate with database? How would this influence the Timer to use?

View 4 Replies

Web Forms :: Include Htm In Aspx From External File?

Jul 18, 2010

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?

View 3 Replies

Web Forms :: Displaying Html From External File?

Feb 6, 2011

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?

View 2 Replies

Web Forms :: Saving Data In Application Or Session?

Mar 6, 2012

i have performance issue when accessing the web application which is datacentric & populaed in a grid

ijust came across storing the data in applicatin or seesion using datatable

i have cutsom paging & navigation causes lot of time though i display records on request

 mean my page size is 75 records / page & at at time only 75 records are fetched i have a query accordingly with the total records of 6780 records

i need to optimize the performace so how do i save it in session or applicatin object & use it

View 1 Replies

Web Forms :: Dynamic File Upload Using External Class?

Nov 4, 2010

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?

View 2 Replies

Web Forms :: Embedded Swf File With Its External Resources To Content Page?

Mar 8, 2011

Under Visual Studio 2010, I'm developing an asp.net application. I added a folder to my project called Flash. Under Flash folder I added a swf file with its external resources to run.

The folder content:
1- ScrollingImages.swf file to lunch the flash
2- ScrollingImages.xml file that the swf file uses to read images from thumbnails folder
3-thumbnails folder which content images used by swf file. I can embed the swf file to html easily using this code:

[Code]....

But when I use the same code to embed it to asp.net page I will have a problem that the flash will run but I cannot see the images so the swf file unable to locate the xml file and the folder of the images location and they all in the same folder.Here is the code I used in the aspx.net content page.

[Code]....

I also tested it in aspx.net page and I'm getting same result no images appear. I know that the problem is related to who to embed the swf external resources (the xml file and the images folder) to the aspx.net page but I searched a lot and I could solve it.

View 1 Replies

Web Forms :: Saving File To Database

Mar 26, 2012

I have two buttons ... one is insert btn another one is fileupload btn.

In the fileupload btn i creat a code in blow. I can upload the file successfully.

I need to insert a file in sql by using insert btn. For that I can create a insert query every thing but I cannot access the string filename value in the insert btn. So how I get the string value for insert btn. I mentioned the insert query also.

protected void  UploadButton_Click(object sender, EventArgs e)  {
         string filePath = FileUploadControl.PostedFile.FileName;  
string filename = Path.GetFileName(filePath);       
string ext = Path.GetExtension(filename);       
string contenttype = String.Empty;      

[Code] ....

Insert Btn:

protected void btnInsert_Click(object sender, EventArgs e) { 
cmd = new SqlCommand("insert into emp(FileName,ContanType, Data)values(@FileName, @ContanType, @Data)", con); 
cmd.CommandType = CommandType.Text; 
cmd.Parameters.AddWithValue("@FileName", filename);  
cmd.Parameters.AddWithValue("@ContanType", contenttype);        cmd.Parameters.AddWithValue("@Data",bytes);
con.Open(); cmd.ExecuteNonQuery(); 
con.Close();  Response.Redirect("Default.aspx"); 
} }

View 1 Replies

Web Forms :: Saving The Data In The Same Text File?

Jul 8, 2010

i have done a small code like if i enter some value in my text box i will pop up a new form corresponding to the value entered i will take the values from the pop up form and click on save and i am redirecting to the previous page and will click on save now i would like to save the data along with the data that is entered in the pop up form

Ex : My first form is like

Name ABC

Address XYZ

Value 3 Here when i enter 3 i will get a pop up if i click on save it will take input 3 times from the user. That data should be carried to the prev form and wiil fill the remaining values in that form and click on save

Phno 12345

now i would like to save my text file as

ABC XYZ 3 12345

View 3 Replies

Web Forms :: Send A Csv File By Email Without Saving It First?

Sep 8, 2010

The following code pulls data from a table writes it to a csv file and then prompts a user to open or save the file.What I need to do is pull the data to the csv file and send it to a predetermined email address, without prompting the user or saving it.How can I do this?

[Code]....

View 7 Replies

Web Forms :: Open Pdf In Page Without Saving The File?

Mar 29, 2010

I saved file (pdf) in DB .

I want when user press on button , open the pdf file on aspx page without asking hime to save it .

i write the folloing code but not working :

Response.ContentType = "application/pdf";
Response.AddHeader("content-length", buffer.Length.ToString());
Response.BinaryWrite(buffer);

View 13 Replies

Web Forms :: Saving Outlook Message File

Jan 20, 2012

I am able to save outlook msg file using Microsoft.Office.Interop.Outlook.dll

Dim objOutlk As New Outlook.Application 'Outlook
Const olMailItem As Integer = 0
Dim objMail As New System.Object
objMail = objOutlk.CreateItem(olMailItem) 'Email item
objMail.To = "test@gmail.com'

[CODE]...

View 1 Replies

Saving A File Into Special Folder When File Is Downloaded On Users Machine

Jul 2, 2012

I need to save a file into special folder.

if (TextBox1.Text == s)
{ MessageBoxResult mbr = MessageBox.Show(this, "Do you want to save file?", "saved", MessageBoxButton.YesNoCancel); // if (mbr == MessageBoxResult.Yes) // { // //string path = string.Empty; // string path; // path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "abcFile"; // if (!Directory.Exists(path)) // Directory.CreateDirectory(path); // }

It creates a folder abc if it doen't exist, i need to save s where s is a textfile.

View 1 Replies

C# - Application Only Partially Reading External Configuration

May 27, 2010

I have an ASP.NET web app and am attempting to reference an external config (using enterprise application blocks configuration) for some of the configuration but it is not entirely working. I previously had all of the configuration info in the web.config (and it was working), but we are wanting to share some of this configuration information between multiple apps. When I put configurationSource tag in the web.config, and read the configuration through the WebConfigurationManager object, it loads some of the external config info (Logging) but not the connectionStrings and not the custom section I created. So it's reading it (logging is working), but some dots aren't being connected and my connection strings aren't coming through.

Again, it worked when it was all in the web.config. I am running .NET 3.5. Any idea what needs to change to be able to reference an external configuration source and have it all come through?

[Code that accesses web.config]
Configuration webConfig =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
ConnectionStringSettingsCollection connectionStrings =
System.Web.Configuration.WebConfigurationManager.ConnectionStrings;
[web.config]
<configuration>
<configSections>
<section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=74025d8738dfe4ce" />
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />

</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<enterpriseLibrary.ConfigurationSource selectedSource="File Configuration Source">
<sources>
<add name="File Configuration Source" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSource, Microsoft.Practices.EnterpriseLibrary.Common, Version=4.1.0.0, Culture=neutral, PublicKeyToken=74025d8738dfe4ce"
filePath="C:MSEABMSEAB.config" />
</sources>
</enterpriseLibrary.ConfigurationSource>
...
...
</configuration>
[external MSEAB.config]
<configuration>
<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=74025d8738dfe4ce" />
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=74025d8738dfe4ce" />
<sectionGroup name="customSectionGroup">
<section name="customSection" type="app.CustomSection" allowLocation="true" allowDefinition="Everywhere" />
</sectionGroup>
</configSections>
<loggingConfiguration name="Logging Application Block" tracingEnabled="true"
defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
...
</loggingConfiguration>
<connectionStrings>
<clear />
<add name="DB.DEV" connectionString="User ID=user;Password=pwd;Data Source=DV1;" providerName="Oracle.DataAccess.Client"/>
<add name="DB.TEST" connectionString="User ID=user;Password=pwd;Data Source=TS1;" providerName="Oracle.DataAccess.Client"/>
...
</connectionStrings>
<customSectionGroup>
<customSection notificationemail="email@mail.com" dirPath="C:Dir" initialrowlimit="500" maxrowlimit="1500" adminadgroup="_admins">
</customSection>
</customSectionGroup>
</configuration>

View 1 Replies

Configuration :: Preparing External SQL Database Fo .NET Web Application?

Sep 30, 2010

It's been so long since I've done this that I don't remember how.

Basically, I am creating a Web Application from scratch. I have dragged the LoginBox to the page and went to "Administer Website". Unfortunatel I see no where where I can choose to have the application talk to an externally-hosted database as opposed to defaulting to the "App_Data" folder. I am hosting an SQL instance named "SQLEPXRESS" on my development machine and have configured a database and user. I wish for the site to use this database and user and have set the connectionstring as follows in the web.config:

<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=RUSSELL-DESKTOPSQLEXPRESS;DATABASE=db;UID=user;PWD=pass" providerName="System.Data.SqlClient"/>

Yet even after adding that I see it showing no where in the "Administer Website" section. Please walk me through getting my application to talk to this database and configuring the necessary tables. I remember there needing to be some sort of exe I needed to run to do this, but my Google and forum searching is failing me.

View 1 Replies

Execute An External Application Such That Each Visitor Gets Isolated?

Jul 21, 2010

Actually 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?

View 4 Replies

Web Forms :: NotSupported Exception On Saving The Uploaded File?

Dec 10, 2010

I was so proud because I researched saving files and figured out how to extract the file name from what might be the full path. However, this doesn't work as I had expected. I still get the exception!

Here's the function that saves the file:

protected string SaveFile(HttpPostedFile file)
{
string savePath = Server.MapPath("~/Articles/");
string fileName = Path.GetFileName(article.FileName);
savePath += DateTime.Now.ToString();
savePath += " _ ";
savePath += fileName;
article.SaveAs(savePath);
return DateTime.Now.ToString() + " _ " + fileName;
}

View 1 Replies

Web Forms :: Reading A File Into Stream And Saving It To A Location?

Oct 8, 2010

I have a third party CMS system that can create forms but can't manage true File upload capabities. I am able to get users brows for thier file and have the value submited to my custom .net code behind page for processing. So I end up with like "C:somefilefoldersomefile.doc".

But on my processing page I want to read this file (like the file uploader) and save it to a location. I tried using the file uploader control (but have it not visible) but realized I can't preset it as I was planning to set it and do the normal processing from there. Is there another way to do this?

View 3 Replies

Web Forms :: FileUpload - Rename File Name Before Saving If Already Exists?

May 7, 2015

according below thread I change file name when users upload from file upload control:

[URL]

below is my code that I changed
if(this.fuppdf.HasFile)
{
string path = Server.MapPath(".") + "../image/House/article/pdf";

[Code]....

if file name be duplicate it add 1 at the first of file name but here it doesn't  work I mean when I upload file i.e catalog.pdf ("catalog is the text in txttitle) it saves in the  host with this name catalog.pdf

but when again I want upload catalog.pdf in host it overwrite last (catalog.pdf) but I want if there was catalog.pdf file it saves with this name 1catalog.pdf in host

View 1 Replies

How To Integrate An External Web Control Into A SharePoint Application's Page

Feb 15, 2010

How to integrate an external web ASP.NET control into a SharePoint application's page?

View 2 Replies

Security :: Accessing Reporting Application From External Network?

Dec 7, 2010

We have an issue with an internal application, where accessing it from LAN (private n/w) works fine, while access from external n/w throws up erratic behavior.

The Current System :

an aspx page (asp version 1.0) hosted on the IIS server (6.1). The front end is a vb form that connects to a sql 2000 database.

Users' credentials authorized using NTLM security.

Access from an external n/w - a reverse proxy configured with an ISA server 2006 to authenticate credentials.

Domain Controller - Windows Server 2008 R2 x64

The issue when accessed from external n/w :

everytime an entry from a drop-down is selected from an Ajax enabled control, instead of the fields populating, the page gets refreshed and the content of the box are cleared.

Also, clicking on other items that normally hyperlink to other pages, results in nothing happening.

Upon investigation, we realized that :

Everytime it fails, a string - "&AuthResend" followed by an alpha numeric string is attached, which attempts to authenticate the user's credentials everytime a request is made to the server.

ISA error logs yielded the following error msg :

"12210 Internet Server API ( ISAPI ) has finished handling the request. Contact your system administrator. "

This behavior is inconsistent except when accessed from Google Chrome, where it fails each time.

We have applied all the recommended hot fixes from Microsoft's KB pages.

View 1 Replies

Web Forms :: Converting Table To XML Format Then Saving It Silently As File?

Mar 8, 2011

Here's what I have in my ASPX file:

<form id="form1" runat="server">
<table border="1" width="100%">
<tr><td>Firstname</td><td>Lastname</td></tr>
<tr><td><%=Request.Querystring("fname")%></td></tr>
</table>
</form>

Here's what I have in my aspx.vb file:

Imports System.IO
Partial Public Class MyexcelPage
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Clear()
Response.Buffer = True
Response.ContentType = "application/vnd.ms-excel"
Dim stringWriter As StringWriter = New StringWriter()
Dim htmlTextWriter As HtmlTextWriter = New HtmlTextWriter(stringWriter)
Me.RenderControl(htmlTextWriter)

Not sure what to do after this or if the above will do anything.

View 5 Replies

Forms Data Controls :: Saving A Web FormView As An HTML File?

Apr 19, 2010

I am displaying data in a Webform View..i need to save the webform view as an HTML file ..

this HTML file will be viewed later using internet explorer.

i was not able to save the webfom as... it is grayed out..

View 2 Replies

Iis7 - External References Slow Down Application (VS: Add Reference Dialog)?

Aug 6, 2010

I've noticed as my website gets bigger and bigger, the time my laptop takes to display my page is much longer then say a new projects with minimal references. I think there are two variables at play that affect ASP.NET warm-up time:

The quantity of external references The time it takes for a worker process to new() up each instance per worker process Additional time for the WCF objects as the ServiceHost may be in an external DLL First, are those the correct variables to take into account when considering ASP.NET startup time? Next, it appears that web.config may dispatch other objects for use with certain filetypes (*.svc, *.aspx, Windows Identity Foundation (WIF), etc. ). This too may cause delays in ASP.NET.

Last, my project is created as a "web project" not a "web site". Not sure if this has an impact. Is my theory full of holes, or is there something I can do to make development on a old laptop any better?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved