asp.net

Set LINQ DSN for DataContext

Hi, I normally store all my configs in the registry. Even though I have started using LINQ I would not like to have the DSN in the web.config, but rather let it stay in the registry and attach it (maybe in the Application Start Event) to the System Config. How can this be done? Thanx for any ideas! edit: to make it clear: I do not wa...

Date/Time Range Validator for ASP.Net

It looks like the standard asp.net 2 RangeValidator control doesn't allow times. e.g. 01/01/2008 12:00 is not accepted in my range, even though it should be valid. If I remove the time it works as expected. Is there a validator out there that allows for date/time format? Update We don't have Ajax extensions. Ideally, would like a pree...

XMLHTTP POST request and System.Reflection

I have a DTS job that is using the MSXML2.XMLHTTP3.0 object to generate a post request to an ASP.NET application. Under the covers, the ASP.NET application is using System.Reflection to acquire some assembly information and I receive the following exception: System.Web.HttpException Error Code: -2147467259 Message Session state ca...

VS 2008 keeps removing and re-adding <SubType>ASPXCodeBehind</SubType>

I've got a VS 2008 C# Web project and whenever I make some changes to the files in it (not even to the project file itself) VS will remove some lines like this from the csproj file: ASPXCodeBehind So something like this: <Compile Include="Default.aspx.cs"> <DependentUpon>Default.aspx</DependentUpon> <SubType>ASPXCodeBehind</SubTyp...

How do you make a ASP.NET Control talk to a Silverlight app on the same page in C#

For example: First, say I have a Silverlight app with Windowless=true so that I can place ASP.NET controls on top of it. Then I place an ASP.NET button on the page. How can I have say the text of a control in the Silverlight app change when the user presses the ASP.NET button? How would I send the Silverlight app an update message f...

Problem with AspNetWindowsTokenRoleProvider for Windows Authentication in ASP.NET

Hi, Im developing an Intranet Application in ASP.NET that uses Windows Authentication. I have created an AD class that gets information from the Active Directory Domain Controller. This is what I use to get things like User Groups that the currently logged user is in. The problem is in the ASP.NET Roles that the user is in. Seems funny,...

VS2008 ObjectDataSource throws Exceptions

I am working on an ASP.NET page with a GridView and an ObjectDataSource. I want to configure the ObjectDataSource against a class (decorated with DataObject()) in my business layer. A class amonst many others set up in a very similar fashion. I select the class and click Next to pick the function for the SelectMethod and it closes wit...

Best Continuous Integration Setup for a solo developer (.NET)

I'm looking for a lightweight, easy to setup CI server that I can run on my laptop along with Visual Studio & Resharper. I'm obviously looking at all the big names like CruiseControl, TeamCity etc etc but the biggest consideration to me is ease of setup and to a lesser extent memory footprint. Edit: I'd also like some suggestions for ot...

iPhone Web App Cache Persistence

How can I write an ASP.NET (C#) application that will render a page can be permanently cached on the iPhone when it is bookmarked as a "Homescreen Icon"? I have tried setting this on the code behind "Response.ExpiresAbsolute = DateTime.MaxValue;" but to no avail. The server code is still executed every time the home screen icon is laun...

DataList, Conditional statements in <ItemTemplate>?

I am trying to do the following in ASP.NET 3.5. Basically, I am binding a LINQDataSource to a DataList. There is a property called "Deleted" and if it is true, I want to display different markup. The following code throws errors: <asp:DataList runat="server"> <ItemTemplate> <% If CBool(Eval("Deleted")) Then%> ...

<q> element not identified in IE 6.0

I have used this in my HTML: <q> Hai How r u </q> Which shows the text in quotes, like "Hai How r u", for example. This is working fine in FF but not in IE 6.0. Please let me know why this happens, and any solutions you might know of. I don't want to use the quote (") character in my HTML or a separate css file for this. ...

How to use Single Quotes in Eval Format String

I've got a Repeater and its SqlDatasource nested inside a Gridview TemplatedField. The Repeater's datasource SelectCommand is set using the FormatString of an Eval from the Gridview. The SelectCommand has a WHERE clause which is to compare a string. Because I have already used the single and double quotes, I am having trouble delimiting ...

Can you set a page's title via CSS or a Skin in ASP.net 2.0

I am using asp.net 2.0 I know can set the pages title via the code behind. But is it possible to set the page title using Theme, skin or css? I need to display a different title depending on the theme selected. ...

Sensitive data in Viewstate?

I need to store sensitive data across few pages (run over https) per session. I can't use session object, for the primary reason being that the session store is designed as just as backup store (primarily make service calls and load the session). If the session has been restarted or in other words that the key in the session does not ex...

Making my ASP.NET website compatible with Firefox?

Hi, i have an ASP.net web site ( http://www.erate.co.za ) version 2.0. When someone open my website in Firefox everything looks different. Why is that and how can i make it compatible? Please help! Etienne ...

How to change FormsCookieName at runtime in ASP.NET

Hi, We would like to have the FormsCookieName of FormsCookiePath change per instance of our application. We have an application which has multiple instances on 1 server/domainname. Because of this we can only work in 1 application at the same time, since the cookies will overwrite eachother. Same for the Sessions btw. Is there a way to...

How to search a string in String array.

I need to search a string in the string array. I dont want to use any for looping in it string [] arr = {"One","Two","Three"}; string var = "One" I need to check whether var variable is present in arr. ...

Would an automatic MSIL to JavaScript conversion be useful?

I've been working on a project called Axial that converts MSIL (compiled C# or VB.NET) to JavaScript. There are a few samples of working code, but some common situations don't work properly. (The current release doesn't work in production mode and the SVN code doesn't work in debug mode but is much cleaner.) I've heard from quite a few p...

ASP.NET url MAX_PATH limit

Hi, I've found an issue with ASP.NET that I know at least has stumped one other person out there. We were trying to use an HttpModule to handle wildcard requests to a web application. The generated url is dynamic and could potentially be several hundred characters long. Unfortunately there appears to be a limitation in the aspnet...

Can I use a VB variable inside of an Embedded Javascript section?

Is it possible to do something like this: <% Dim foo as string = "bar" %> <script type="text/javascript"> var baz = <%=foo %> </script> Where the <script> tag is embedded on my index page? ...