.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

FTPWebRequest Issue

Posted By:      Posted Date: September 21, 2010    Points: 0   Category :ASP.Net

I have written the following code that successful ftps a file to the proper location as long as the file exists on the server itself....

However, I need the code to pull the file contents from the client computer, not the server. 

Here is the code:

        /// <summary>
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSubmit_Click(object sender, EventArgs e)
            if (Page.IsValid)
                    FtpWebRequest ftpr = 
                        (FtpWebRequest)FtpWebRequest.Create(@"ftp://" + ConfigurationManager.AppSettings["remoteHost"] + "/" + 
                                                                        ConfigurationManager.AppSettings["remotePath"] + "/" + 

                    ftpr.Credentials = new NetworkCredential(ConfigurationManager.AppSettings["remoteUser"].ToString(), 

View Complete Post

More Related Resource Links

IsapiModule Error 500 Issue


I am about exhausted trying to figure out this error:

HTTP Error 500.0 - Internal Server Error

Description: The page cannot be displayed because an internal server error has occurred.

Error Code: 0x8007007b

Notification: ExecuteRequestHandler

Module: IsapiModule

Requested URL: http://localhost:80/ReportServer

Physical Path: c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer

When I enable Failed Request Tracing Rules and view the log output I am supposing that the actual problem is in the 2nd call where there are 2 backslashes before the actual filename in the specified path:


CALL_ISAPI_EXTENSION DllName="C:\Windows\Microsoft.NET\Framework\v2.0.50727\\aspnet_isapi.dll"


MVC2 issue - Stuck. Trying to create a cms with nested partials


I am currently trying to display multiple items on a single page. I am not sure as to how to tackle this. What I have is a database table that has all the page data in. I have this run as a PagesController and this works fine. However what I would like to do is, if say the Products page is selected via the menu, I want to pull back not only the Products page html but also get all the products, and even be able to pull them through via category. I was trying to use a partial view, but I can't get it to work. The same would be for other pages, having partial views to display the other content, ie if Gallery is selected, the page html for Gallery shows and it then can push to a partial view that pulls all the gallery images from the gallery db table and so on. 

Maybe I am tackling this the wrong way. I have the pages stored in the db to allow for a CMS system I have setup. Maybe I need to use models for all the other items(Products, Gallery, Videos and such) and use the partial for the page html?

Any help would be greatly appreciated as I am confused.

xpath issue


Hi i am using xpath to loop through each node,

the xml is below i can get the value of "link" but i cant get the thumbnail value, have you got any ideas how i can do this, my code is below.



     <link>test 1</link>
     <media:thumbnail url="http://test.com/image.jpg" height="75" width="75" />



     <link>test 2</link>
     <media:thumbnail url="http://test.com/image.jpg" height="75" width="75" />


public void FindLinks(XPathNavigator p_xPathNav, DataTable dt)
            //run the XPath query
            XPathNodeIterator xPathIt = p_xPathNav.Select("//item");

            //use the

User validation Issue in xlsx file



I am validating user from Login.xlsx file. It was working fine by validating email and password from that file. For testing i got new file same contents of file but added some more user names.

So after that when i validating the user i am getting the following error "Data type mismatch in criteria expression".

But when i replaced the new to old one it is working fine. The contens of both files are the same. So why this kind of error happened.


Multiple Paramatized Threading issue


I need the funcitonality to have two methods run concurrently of each other and the parent thread (aka the method that makes these two calls) to halt until BOTH are done. After the threads are done, I need to perform logic on the returns of the method, so it is essential for both of them to be complete before the parent thread continues. I have searched the internet and tried varous attacks, and I always come up with the same result, this being the parent thread continues operation after the first thread finishes, leaving the second thread running.  Can someone show me a quick example of how I can do this. I have tried checking states of the threads, halting the threads, but I always end up with the same thing. Any help would be great. Thanks.

Data Truncation issue with Enterprise Library Logging WriteLog stored Proc


Hi ,

I'm using Enterprise Library Logging  feature for logging. The issue i am facing is when the Logging message is too large(more than 65534 chars) ,complete data  is not logged in the Formatted Mesage column which is  of data Type nText .

I am able insert complete data if i try inserting from Sql insert Query from sql management studio. Do i need to add any attributes to data base listener or do i need to change the sp.

 Is there any way to increase the WriteLog stored proc param size in EnterpriseLibrary.Logging config file ? . Please let me know.


Thanks In Advance.

Word Automation Issue in Windows Server 2008 Hosting



The problem I am posting here is that I was facing nearly 2 weeks around. Any body comes with this stuff please help.

Word Automation in sample ASP.NET(C#) application.

I am using Microsoft.Office.Inetrop.Word Assembly for automation. Here I am reading a XXX.dot template file and fill the contents with dynamic data.

When i am executing my code in localhost:someportnumber the automation is working fine and I could get expected result and when I am hosting in my inetmgr(Windows XP is my OS) it is also working fine.

But the problem is that when I am hosting in my production server(Windows Server 2008 Standard Edition) I am not able to perform automation and results in the following error.

Data: System.Collections.ListDictionaryInternal
Message: Word has encountered a problem.
Source: Microsoft Word

The code gets failed in the following line:

ApplicationClass wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();

Document wordDoc = wordApp.Documents.Add(ref oTemplate, ref oFalse, ref oMissing, ref oMissing); // Error in this line

I cannot able to proceed further. Can anybody please help me in solving this issue?

Thank you.

With Regards,


If Statement Issue



This is very strange to me. I have spent 2hrs looking into this inside out , but dont seem to get it

I have an if statement that inserts data into the database. But i check to make sure the name is not entered twice. Now when the name is already in the db, then it should insert else put out a message saying its already in the db

My code works fine except that  when its not in the db, its inserts but still puts out the message that says "Name is already in use" Not sure if am not seeing something. But thought i did bring it to the forum. Here is my code...Pretty simple

Protected Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click

        Dim objConnection As SqlConnection
        Dim objCommand As SqlCommand
        Dim strSQLQuery1 As String


        ' If there's nothing to Add for then don't search
        ' o/w build our SQL Query and execute it.
        If String.IsNullOrEmpty(txtAdd.Text) Or Leadbank.SelectedValue = "000" Then


Toolbox: Issue and Defect Tracking, Automate IT Tasks, and More


In this issue, issue and defect tracking, automating IT tasks, and more.

Scott Mitchell

MSDN Magazine December 2006

Repeater issue, all code inside Repeater are not shown


I have a Repeater who should show some data from my ms.sql server. But all code inside the Repater is not shown on my .aspx page. What am i doing wrong. I have a similar Repeater on another page and there it works fine.


 <div class="AnsaettelseKontrakt Folders">
      	            <table cellpadding="0" cellspacing="0" width="750px" align="right">
                            <th class="BrugerHeader" style="width:300px;">Filnavn</th>
                            <th class="BrugerHeader" style="width:80px;">Størrelse</th>
                            <th class="BrugerHeader" style="width:150px;">Dato</th>
                            <th class="BrugerHeader" style="width:180px;" colspan="2">Brugere</th>
                            <th class="BrugerHeader" style="width:40px;">Værktøjer</th>
                        <asp:Repeater ID="RepeaterAns" runat="server" onitemcommand="Repeater1_ItemCommand" >
                                <tr class="Br

how i can solve this issue in sql server



when i open my sql database in webmatrix then i got this error.  i already install sql server 2008 r2 and he work fine everywhere in my system.

how i can solve this issue.

Datalist with embedded Grid or List...Sub Totals issue with iteration


Let me see if one of you can assist with this one...


i have a similar situation, but mine does not use the selected item (item Command). Here is what the form is to do:


1. this is for an educational environment, so we use SID- NOT SSN's, but i use the SID as a filter in the subset as the grouping unique id.

2. I'm trying to inject a sub total row at the last line item of each SID (if more than one item in the report for that SID).

3. I'm looping thru the items in the Datalist Item Command with a for each (item i in Datalist2.Items).

Custom controls and ViewState management issue



I want to know that when we create custom controls, then is there State Management through ViewState done automatically or we have to handle it explicitely ?Since i have created Custom Controls that is behaving as if it is not maintaining its state on PostBack.

How to solve concurrent site issue


Hi All,

I have developed a ASP.NET2.0 web site with SQL 2000 backend and number users to site is approx. 5-10.

I have developed one Administration page which controls user roles to access this site; onclick of Update button in admin page the role gets updated into the system. I have written simple query in the code to update the user roles into database; Ajax implemented in admin page;

Issue: If 2-3 users tries to update the admin roles; latest update reflected in the database and same displayed in the admin page;

I am looking for a solution to solve this problem by application code change since i dont have flexible to change the database end; if one users update the system, it should not allow other users to perform any operation; please let me know if any standard approach can be implemented with minor code change.

Thanks in Advance,

Saravana Prakash P.

asp.net path issue


Hi all,
I am working on an application where many hyperlinks ( <a hrefs> like <a href=/web/index.html ) are used. The website is working fine on live server. The previous link goes to wwww.mysite.com/web/index.html which fine. But when i setup the website on my local machine. The above link goes to
http://localhost/web/index.html which is not correct path and I get resource not found error. If i correct the path in browser like this :

(Imperfect) Solution to TreeView Postback / Client-Side Node Selection Issue


I've seen this question posted on all corners of the web... "How do I disable "AutoPostBack" on the ASP.NET 2.0 TreeView control?!"  Unfortunately, most of the answers either don't work, miss the point (don't work right), or boil down to "You can't do it."  I happen to know that this behavior worked perfectly in the IEWebControls TreeView that Microsoft released as an add-on prior to ASP.NET 2.0, however.  So I set out to find a solution for the ASP.NET 2.0 TreeView issue.

In a nutshell, the behavior that I and others are looking for is to have a TreeView rendered in a page that allows the user to expand, contract, and select nodes within the TreeView without causing a PostBack to the server.  This implies two things: (1) the most recently-selected node should be recorded as the currently-selected node [i.e., at PostBack time, the most-recently selected node is actually represented as the SelectedNode]; and (2) the selected node should exhibit the SelectedNodeStyle as specified in the TreeView declaration.

It appears that the TreeView engineers saw only two possible outcomes from selecting a leaf node in a tree: (1) immediately posting back to the server, or (2) immediately navigating to another web page.  They apparently did not consider option (3) just allowing selection in-place on the client, while waiting for a click on so

JavaScript iframe resezing issue



I have an iframe that is supplied by another application, inside the iframe I have my .Net application. However, I am having sizing issues, where one minute that pages in the .Net fit the frame perfectly and the next minute they don't, with a vertical and horizontal scroll bars appearing. All the .Net Pages use a Master Page and I have also fixed the size of the pages, but with no luck. What I would was thinking if possible is to pass some javascript between the .Net application and the iframe which will make the pages and the iframe resize themselves. Has anyone done this before and have some code that I could use?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend