asp.net

Is there a simple way to get unique items from DropDownList?

I am trying to grab all unique items from a DropDownList. Is there a simple way to do this? ...

How to detect variable *name* (not type) within a function (Why? For a custom ASP.Net databinding implementation)

So, let's say I have this code (VB.Net): Sub Main() dim xxx as string = "HELLO WORLD" DetectName(xxx) End Sub Public Sub (theVariable as string) dim output as string = "The Value: {0} was stored in the variable named: {1}." debug.writeline(string.format(output, theVariable, What Goes Here????)) End Sub Te output I want ...

Processing static files via HttpModule in ASP.NET

I have statiс files in website folder, but need to check permissions for every file. I decided to use HttpModule for that purposes. ASP.NET receives all the http-requests (I used wildcard mapping) and The algorith is the following: HttpModule receives the request HttpModule checks permissions If access is denied then the answer is ...

How do facebook applications work?

Hi, Here's a little bit about my situation: I want to be able to retrieve a list of emails for the friends of a given user. Here is how I would like the process to go: A div box pops up with a login (used to log in to their facebook account, not my website's account system - that is separate) Then once the user has entered their face...

asp.net custom role provider not working in sandbox

Hi all. We've build a custom role provider and it was working fine locally, running Cassini. However, once we put our code in our sandbox environment, it stopped working. We've put debug statement in the custom role provider's code and it seems like that the custom code is not even getting execute. All the web.config is still the sam...

Adding a second <%@Register %> line to my page causes Compilation Error

When I have just one <%@Register %> line in my page, it loads fine. When I add a second one, it gives me this compilation error: Compiler Error Message: CS0433: The type 'ASP.test1_ascx' exists in both 'c:\Users\me\AppData\Local\Temp\Temporary ASP.NET Files\root\c2d75602\aae4f906\App_Web_dta-e2tq.dll' and 'c:\Users\me\Ap...

Importing namespaces isn't working for an API I just installed...

Hi, I just got the Google Data API and I can't seem to use it in my application. I got the msi file, built the Google Data API SDK successfully. Then I went back to my project, right clicked on the Bin folder and selected Add Reference... From there I added all of the dlls in the C:\Program Files\Google\Google Data API SDK\Redist folde...

Whats ADO.Net Data Services? and how it can help me while building ASP.Net websites?

Whats the ADO.Net Data Services ? Whats the advantages it will give me while building an ASP.Net website. I used to make my JavaScript client side code call a web service and get back a json for Ajax calls on my page. Is ADO.Net Data Services something which will help me in this scenario, it can simplify returning the data or its talk...

Preview ASP files without server.

How can I get any browser to just treat a .asp/.aspx file as if it was .html and render it? (Without installing ASP server). It always pops up with a download box or displays the source. Preferably for IE8. On Vista. Thanks. ...

Get Windows Service Description ASP .NET

I'm writing a service monitoring ASP .NET app and I'm having issues particularly with getting the service descriptions. My current method (reading from registry) is not going to work due to registry read permissions on the production server. For example: Microsoft.Win32.RegistryKey system, currentControlSet, services, service; system =...

Smart way to disallow users going to a site page directly

A site has 100's of pages, following a certain sitemap. A user can navigate to page2.aspx from page1.aspx. But if the user goes to page2.aspx directly say through a book marked URL, the user should be redirected to page1.aspx. Edit: I dont want to go in and add code to every page that needs to fulfill this need. Note: This is not a cr...

unable to connect to ASP.Net development server issue

Hello everyone, I am debugging codeplex simple project => http://www.codeplex.com/sl2videoplayer. I am using VSTS 2008 + C# + Windows Vista x86 Enterprise. I have not modified any code of this codeplex project, and just press F5 to run VideoPlayerWeb project. The current issue I met with is error message -- "Unable to connect to ASP.Ne...

Downloading images

I have a requirement where a user can specify a url http://www.mysite.com/displaythread.php?t=863 He then specifies total no of pages in that thread and the software automatically loops through all pages and downloads images For eg: If no of pages is 20, then the pages looped will be in following manner http://www.mysite.com/display...

How do I open a popup window in ASP.Net with HyperLink control using external javascript file?

Using ASP.Net 2.0 a. On a parent ASPX page, after a HyperLink control is clicked, I need to open a (child) page in a popup window, as modal. b. Then when that popup window (child page) is closed, I need to get the selections from a datagrid on that popup window and refresh the parent page accordingly. c. I have open window javascript...

How can I get a regex to check that a string only contains alpha characters [a-z] or [A-Z]?

Hi, I'm trying to create a regex to verify that a given string only has alpha characters a-z or A-Z. The string can be up to 25 letters long. (I'm not sure if regex can check length of strings) Examples: 1. "abcdef" = true; 2. "a2bdef" = false; 3. "333" = false; 4. "j" = true; 5. "aaaaaaaaaaaaaaaaaaaaaaaaaa" = false; //26 letters Here...

Problem Export data from dataset to Excel

I want to export data from dataset to Excel using C# in Asp.Net ...

Keep Elements on Same Horizontal 'Row'

I have the following div in a page, but the button is being rendered below the input, despite there being plenty of room for them both in the same 'row' as I want them. How can I force this 'same row' issue? <div id="pageHeader" style="text-align: right;"> <asp:TextBox ID="searchInput" runat="server" CssClass="searchTerm"> </as...

What is the best approach to make DAL?

I want to make a perfect custom DAL (data abstraction layer) class to use with all my projects. I've searched the internet and found some samples for this but I never know which is the best approach. Is it to make [Attributes]? Or use <Generics> or something else? So please just give me a head line and I'll go on from there. Thanks a...

ASP.Net Session State

Hi, I was wondering whether it would be possible to change the sqlConnectionString used for SessionState in ASP.net based upon the domain an application is running on? A scenario; We have 20 sites running from one application all talking to different databases depending which domain (site) they are browsing from. When browsing www.d...

Are you using the Microsoft Enterprise Library?

In my shop we currently develop what I would consider small to medium sized projects. We have been investigating the Enterprise Library and how it may be able to help us in development. I have particularly been looking at the Logging block and comparing it with Log4Net. It seems to me that the Enterprise Library blocks would be an ext...