.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

Viewing files only from a web page

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :ASP.Net
I have some images and text files that are used by web pages that are available to anonymous users and therefore those files can be viewed directly from a browser. Is there a way to avoid this and allow the files to be viewed only when a page in the web site calls it ?Humberto

View Complete Post

More Related Resource Links

css files not loading when viewing page at http://localhost...

Hello, has anyone had the following problem: css files are in the head element, and the styles are clearly being picked up by the .aspx page when in Design or Split view. Yet when running on localhost, the stylesheet has no effect. And when publishing the website to IIS on a remote server, the css clearly does take effect. I've never seen anything like this... 

Viewing your In-Box from the Home Page


I have a user request to access the user's Outlook In-Box from the home page in SP 2010.  The OWS In Box web part requires a hard-coded email address.  Is there any way to have the web part accept a variable?  That way I could pass the email address from AD.


Tom C.


jpg files will not display in gridview on aspx page

I have an image object in a template of a gridview The datasource of the image object evaluates to the path of the jpg file. However, the aspx page displays a little red x instead of the picture. How do I get the image to display/Frank learning vs 2005

Masterpage didnt get applied to a particular _Layouts files(application page) for EditUserPref.asp

Master page did nt  get applied to a application page  (_layout file),   but other layout pages have the master page applied. EditUserPref.aspx  ->  Im accessing from search preference - http://i34.tinypic.com/34xi9t5.jpg  

Upload large files from a web page

I am trying to figure out a solution to upload large files under a web page. I know WCF + Streaming is a proper solution for large file transfers, but I am not sure how to get the WCF client implemented under ASP.NET. Here is the link: http://mark-csharp.blogspot.com/2009/01/wcf-file-transfer-streaming-chunking.html Please advice if you have any solution.   Besides, is there anyway I could implement a progress bar showing the upload progress while the file is being uploaded, and voiding page timeout?

How to securely display PDF files on a portal page


Hi guys,

I need a control that display a PDF file from MOSS library so that user can't get a copy of it. I perfectlly understand that's not possible to completely save document from copying, I just want to make it as hard for user as possible.

So far I embedded a PDF file into user control as described there:


But I still have 2 major propblems:

1) displayed PDF file's saved at Temporary Internet Files after each page download

(Response.Cache.SetCacheability (HttpCacheability.NoCache) doesn't help)


2)if page is opened as a Source file then a link to a PDF is clearly visible inside UserControl code.


Is there a chance to avoid any of these issues? Or may be you have any other ideas?

Error: There are no page layout files available in the master page library of the top-level site.

I exported one of the subsite using stsadm and imported into a new site collection, I could access the new site collection but whenever I try to create a new page in my new site collection I get the following error.

There are no page layout files available in the master page library of the top-level site. Add one or more page layouts to this library before you create a page or set page properties.

Please help. Thanks.

Application Page development: deployment of files


If I develop a 2010 Application page using VS2010 and an Empty Sharepoint Project to which I add an Application Page item, the aspx page  oes under the 14 hive \Layouts folder in a subfolder of my naming. The code behind goes into the resulting assembly which I choose to deploy to the GAC.

But say my aspx page has accompanying XSLT files - what is the correct location for those files?

Viewing original blog posting from search page

I have an installation of WSS 3.0 with a blog.  When users search in the blog, results are returned as expected on the search page with one line containing the search phrase.  However when they click on a result they are taken to a Comments page for the posting and can't see the text of the original post which is generally the reason for the search.  The link on the search hit (ex: http://server1:8000/thelog/Lists/Posts/ViewPost.aspx?ID=232) does the same thing.  How can they access the original text of a blog posting from a search or how can the original text be included on the Comments page?  Thanks!

i want to add media files to my web page


I have been trying to add media files such as audios and vedios to my web pages in visual studio (asp.net) but i seem to be lost about the whole thing. can i have a helping hand on this??????

Thanks 2 you all

Webbrowser viewing page problem.


I've made a webrowser form.

And it all works fine but, there is a certain website that gets all screwy when it is viewed in a webbrowser. It prob is the way the website was made. Would there be anything I can do for the webbrowser?

Here is a picture of them.


This first one see how there are some things behind it.



This second one when I click on an section it shows it was clicked a little bit above.



This third one some times when I click on a section everything disappears completely but the sections.



This fourth one there are like private messages, user cp, and all that. It is not even supose to be near where it is now.

It is suppose to be way at top of entire section.



Anyone know how to fix this without fixing the website?


How can I create multiple files all referencing the same aspx page?


 Basically I need multiple code-behind files each containing different functions for a page. Different classes do not do this because they are not connected to the page so their methods require parameters I want direct control of the page without the need for parameters.

I can only seem to crete one code-behind file and I need many. I've tried putting the aspx page in the App_Code folder but this causes an error.

Is there a way to do this?. Any help would be appreciated.

why lightbox does not dim entire web page when viewing popup


I am using lightbox to show youtube video on webpage, when I click link on page, it opens up fine in all browser, but why in Internet Explorer , it does not dim the entire page, it custs off bottom parts, any one has any idea.

please let me know

thank u


SharePoint 2010 Master page feature stapling - not sure where to put files


I have successfully added a branding feature to my 2010 environment that activates on install. Just as expected, it does not work for subsite creation. I have seen a number of articles/blog posts on how to create a feature stapler for SP2007. However, I am having a hard time finding a working solution for SP2010 using VS2010.

I have a couple of questions that I hope someone can point me in the right direction on:

1. In my project I have a branding feature, this contains the EventReceiver that applies the change. Can I have a second feature here that does the stapling or does it need to be in a completely seperate project?

2. Everything I read points to two files feature.xml and elements.xml, are both of those supposed to be under Features in Solution Explorer or are they located somewhere else or do they need to be create. If they need to be created, where do they belong?

3. In the EventReceiver.cs file there is a GUID that was automatically generated. Is this the GUID referenced in the feature.xml?

Hopefully with these questions answered I can move forward and find a solution to getting the stapler working.




Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:

Changing the graphics on the home page of a SharePoint site

When you create a site in Microsoft Windows SharePoint Services by using the default Team Site template, the home page includes two default graphics. A Windows SharePoint Services graphic appears in the body of the page, and a picture of a house in a circle appears near the site title. You can change these graphics to customize your site. Changing the smaller graphic requires a Windows SharePoint Services compatible Web page editor

Using jQuery to directly call ASP.NET AJAX page methods

Here I am looking to explain how to call page methods using jQuery. Using jQuery to directly call ASP.NET AJAX page methods
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