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

Top 5 Contributors of the Month
Post New Web Links

Opening a folder in a new browser

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :ASP.Net
Hi, Developing a web application in C# which stores files in a tree structure in a server.A project ( eg: ABC) has many sub folders (eg: ABC_sub1,ABC_Sub2...etc) . Each sub folder will have many types of files. (Eg: .dat,.txt .... etc)I have stored the project name and the path to the parent folder ( in this case ABC) in a database.Eg: \\sereverName\Test\MyProject\ABCWhat I need to do is when a user selects a given project ( eg; ABC) & clicks the link button component  called "browse"  to open the folder (\\sereverName\Test\MyProject\ABC) in a new window.This is the code I thought would work.protected void LinkButtonFolderBorwse_Click(object sender, EventArgs e)    {        string myPath = @HiddenFieldFolderLocation.Value;        System.Diagnostics.Process prc = new System.Diagnostics.Process();          prc.StartInfo.FileName = myPath;        prc.Start();    }HiddenFieldFolderLocation.Value gets the path of the parent folder (\\sereverName\Test\MyProject\ABC).When I click the link button nothing happens.Any help would be greatly appreciated.Thanks

View Complete Post

More Related Resource Links

Browser window is opening up on the second click with javascript code



I am trying to set a javascript code to open up a new browser window with this URL that exists like shown below.

On the first click nothing happens but on the second click the browser window is opening up.


How is it possible to make it open up on the first click ?

                                <asp:ImageButton ID="ImageButton3" runat="server" Height="84px" 
                                    ImageUrl="~/images/1.jpg" Width="165px" 
                                    onclick="ImageButton3_Click" />

    protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
        String openURL = "javascript:window.open('" + "Folder1/testing.aspx" + "');return false;";
        ImageButton3.OnClientClick = openURL;


opening a web browser without opening form on windows form load event

Hello All, I have a main frame which has a display button. after clicking on display button I usually open a windows forms. Now I have a requirement to open a web page after clicking on display button. I should not show windows form to the user. for that I had written following code in the Form_int (override) event of windows form. System.Diagnostics.Process.Start(http://www.google.com); and I commented out ShowDisplay(); code.  Everything looks good till now and when I run the project and clicked on display button web browser has been opened, but if I click again another web browser is being opening. but I don't want another browser to be opened. can anybody please help me in that. Thanks in advance.

Help: Folder Browser App Using TreeView on a ModalPopup



 I'm working on an ASP.NET (.NET 4, VS2010) app that needs folder browsing/picking capabilities.  I've got it mostly working, but I'm stuck on one last thing.  (see below)  Also, I'm using AJAX UpdatePanel, TreeView control, and AJAX Control Toolkit ModalPopupExtender.

 When I go to the page, I load the TreeView with a top node and a first set of child nodes, which are the found drives of the server.  Then I click a LinkButton to open the ModalPopupExtender, which contains the TreeView.  When I click the nodes of the TreeView, the node expands and builds a set of child nodes which are the folders found.

 What I want to happen is to allow the user to navigate through the TreeView, selecting drives and folders until they find the one they're looking for.  Then they click OK to return the path selected back to the main form.

 The problem is that any click of any node in the TreeView causes a postback and my ModalPopup closes.

 Maybe what I'm doing is not possible, but does anyone have any ideas on how to accomplish this task?  That is, how can I keep the ModalPopup open while the user clicks through nodes of a TreeView in which the child nodes are populated dynamically?

 (Sorry in advance for the really long post.  There's a lot of code below.)

Opening links from WPF WebBrowser control in default browser instead of IE

I am working on a WPF application that uses System.Windows.Controls.WebBrowser to display an embedded HTML page.
The problem I have is that all links from that page that are to open an external browser window (with target="_blank") open Internet Explorer instead of the configured default browser.
How do I tell the WebBrowser control to respect the default browser settings?

Opening New Browser WIndow


Is it possible to Open a new browser tab/window using c#.  I have query string info I don't want to put in a hidden field due to it showing on the client side.  I do save the data in ViewState and encrypt the viewstate; however, I don't know how to access that information on client side. 

I can access the viewstate data fine on Server Side but I need to open the new browser window on server side in order to access the ViewState.  I may be wrong.  Is there a trick to this? 


I did find a way; however, on any other click after the initial click everything goes to a new window:

:LinkButton OnClick="btnEmployeeGridEdit_Click" ID="lnkEmployeeEdit"

Opening an XSLT file in my layouts folder


Hello all,


I'm creating an email templating system using XSLT files for the templates. I need to be able to access these XSLT files from code, so i'm deploying them in a layouts folder - how can I then open these files? I can't figure out how to create a valid path without hard coding the hive path (a bad thing!).

I'm vaguely aware that i can access these files by URL as they're in a layouts folder, but so far i'm getting a 401 when i try to grab them - ideally i'll be able to open them with a full file system path and use things like File.exists()

All help appreciated!


Opening a WordprocessingML document from the browser


We have this great asp.net web application that generates word documents (wordprocessingML) and saves them to the file system on the server.  We are running IIS 6.0.  I would like to know the best way to allow the user to click a link or something so they can open the document from the browser.  I have been experimenting with the Microsoft.Office.Interop.Word object, but am getting an error when I try to active the application object.  I don't know if using this object is the best approach or if I should be doing something else.  I would appreciate some guidance here.



Some times FormEvents_Loading() is not firing when opening infopath form in browser.


Hi All,

I am facing problem in infopath form published in form library. There are 5 different view depending on the user.

Sometimes the FormEvents_Loading() is not getting invoked. As i check using log function on every setp inside formevent_loading().

But when i click refresh button on browser,it works fine.

This is creating problem with users as they see wrong views.

Pls Advise how can i resolve this..



-- Regards Sandeep

Browser Based Infopath form Opening Problem



 I am having some problem regarding infopath form.Actually i m using Browser based infopath form.

 I created the browser based infopath form and then i choosed full trused and added the certificate and then published with admin approved and then installed and activated from the central admin.

if client machine is having the Infopath Installed on that machine, I m facing some prob to open that infopath form on the client machine(asking windows crediantial again and again and at last the form was opended but the webservice was not retrieving the data on the infopath form) .

But if the client machine is not having the infopath installed then the infopath form is opening in single click.there is no issue in this case.

 so can u confirm me that if we are creating browser based infopath from then the client machine should not have infopath installed on that machine. Is this right?

Actually i m working on client site and lot of..... 1000 machines is here and every machine is having infopath form installed. So will every machine need uninstall of infopath?

Pls try to give me the solution.


Regards- Sharad

Infopath forms no longer opening in browser after updating sandbox tier


Hi there,

Ever since i've updated my sandbox default tier, infopath forms from forms libraries no longer open in the browser when u click on "add document". Instead it insists on opening the infopath desktop filler.

All the features are still enabled, literally the only thing that changed was the tier settings.

Could anyone offer any ideas?

The world is the mollusc of your choice

How to setup a Mobile Browser Emulator in Windows Mobile 6:

In the following tutorial, I cover the process of Setting up Windows Mobile 6 for Mobile Browser Emulation using the Microsoft Device Emulator. This enables a user to experience Windows Mobile 6 on a PC via Emulation without even owning a Windows Mobile 6 product. It can be a great way to test drive Windows Mobile 6 before purchasing a product with it installed. In our case, it allowed us to Emulate Windows Mobile Browsing so that we could optimize our sites for the Mobile viewing audience. Installation and Emulation is simple and fairly straight forward.

*.axd script references not being rendered to browser


I'm running VS2010 with .net 4.0, and am running into issues with the .net ajax script tags mysteriously not being rendered to the browser.

So far I've reduced it to a scenario where I set the DataSourceID property of a databound control.  More specifically, I've only tested it on a Gridview and a DropDownList.

This can be reproduced fairly easily on my machine by following these steps:

1. Create a new empty Web Application Project

2. Create a new Web Form

3. Add a ScriptManager inside the form

4. Add a DropDownList and a DataSource (I used an ObjectDataSource)

5. Set the DataSourceID property of the DropDownList to the ID of the DataSource.  This can be done either declaratively on the .aspx page, or in the code behind in the aspx.cs page, and both produce the same results.

6. Open the page in a browser and watch as you get a javascript error stating "Sys is not defined" and notice that the page source contains no script tags referencing *.axd scripts.

Here's my source code showing my set up:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ScriptResourceFAIL.Default" %>


Visual Studio closes itself by opening aspx-Page designer after Windows Update


Hey Guys,

I've a problem with my Visual Studio.

On the 13th of August 2010 i installed a Windows update on my vista sp2 pc. For this date my Visual Studio 2008 sp 1 always has closed itself by opening an aspx-page in designer view. There is no error message just closing the window. I restored a backup of my windows from the time before updating it and it helped, i could open aspx pages in the design view till the update has been installed again automatically after rebooting the pc. I can't disable windows updates, cause it's my pc at work and safety is very important. I hope you could help me out of this disaster.



WebDev.WebServer.exe has encounted a problem and needs to close when trying to view page in browser


Hi, whenever I load an aspx page in vwde2008, I get the message in the subject of this post.  After I click Ok on that, I get a dialog box, Unable to Connect to the ASP.Net development center.  What can I do to troubleshoot?

I am using Windows XP SP3, vwde2008 with SP1, on a HP desktop.  Also using Office 2003 if that is relevant at all.

Thanks, Justin

browser gives jibberish when State manager (sql) is turned on


Hi all, we're testing our web app with a state manager so that we can do distributed rollouts. We're not getting any errors, but we are getting jibberish returned for every page request. 

(it won't even let me paste it in here)

HOw do I get it to serve the pages normally?


ASP.NET Configuration not opening


I recently upgraded to VS 2010 and downgraded to SQL Server 2005. Now when I go Website > ASP.NET Configuration nothing happens.

It's likely this has to do with the fact that when I was installing SQL Server I got the 'ASP.net Version Registration requirement' warning, as well as the 'Failed to find the ASP.net Version Registration requirement with MS IIS'.

Anyone know what I need to get ASP.NET Configuration working?

displaying xsl results in browser


Hi guys,

How can I test what my xsl spits out in the browser, rather than just viewing the xsl itself?


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