asp.net

How to get file name of any page regardless of URL?

I would like to force SSL on certain pages around the site, like for login, registration etc. by specifying a string array and checking whether the current URL fits a certain criteria in a custom HttpModule. It works well, as long as the URL correctly reflects the page, however I use routing tables, so some requests I point to login pag...

ASP.NET C# scope issue

OK, so I'm tyring to work with some simple stuff in ASP.NET and C# to get the hang of the super super basics, and I'm having trouble finding out how I can get this scope issue to work. At least, I think it's a scope issue! :) So, here is my Default.aspx presentation markup: <%@ Page Language="C#" Inherits="project1.Tree" %> <!DOCTYPE ...

Adding machineKey to web.config on web-farm sites

We (out IT partner really) recently changed some DNS for a web farmed site we have so that the two production server have round-robin DNS switching between the two. Prior to this switch we didn't really have problems with WebResource.axd files. Since the switch, when we hit the live public URL, we get an error: CryptographicException...

read http custom header from asp.net web service

cant read http custome header "MSISDN" from my web service ... same code works on regular asp.net page. Can anyone shade a light on that subject ? ...

Would Quartz.NET calendars be a solution?

Hi all, I'm using Quartz.NET for a project for work and I have a request off my manager for a feature, which he isn't sure is feasible but I'm very interested in doing this. Basically, there needs to be an option to change the scheduler to do a different 'configuration'. By this I mean, disable certain jobs when this configuration is c...

ASP.NET: Multilingual support without resource files.Whats the best approach and data structure ?

I have an asp.net web application which i want have multilingual support now.For some reasons,the management is not ready to use satellite assemblies or resource file.They want to have it table driven.so i created tables to store the text for each part of the page.I dont want to make a call to db every time the page control loads.Ex: if ...

Add delegate or event property to this class?

I created a control where other developers can create an instance and use. There is a button click in the control. How do I allow developers to plug in their own code in a certain part of my control? I am not sure if or how exactly to use a delegate or event in this scenario. Can someone help in the below example: public class MyControl...

trigger onresize in cross browser compatible manner

I would like to trigger the onresize event from my C# code behind. I think this can be done with Page.clientScript.RegisterScriptBlock(this.getType(), "id", "javascript code"); I have tried element.onresize() but it doesnt seem to work in firefox. What is the correct way to trigger an onresize event similar to the following jQuery? ...

Is it possible to run PHP and WCF on the same Azure instance?

I'm investigating the possibility of hosting a CMS (wordpress written in php) on Azure. I'm already running an ASP.NET Web Role which exposes WCF services. WordPress requires PHP. All my research suggests that I should create a new CGI Web Role to handle the PHP functionality. Is it possible to run the CGI Web Role and the ASP.NET We...

disabled control being reenabled but still not posting back contents to server

I have a couple of radio buttons that are controlling text entry into a textarea. <tr id="trTextNote" runat="server"> <td colSpan="2"></td> <td class="IndentedCell" noWrap colSpan="2"> <asp:textbox id="txtIncludeNote" runat="server" Width="352px" Height="46px" TextMode="MultiLine" MaxLength="250"> </asp:textbox> </...

ASP .NET Validators broken in FireFox

Hi, I'm struggling with ASP .NET Validators JavaScript issue. Following function (part of framework generated code) tries to access validatioGroup attribute value using control.Field syntax. It works fine in IE, however in FF that value is always undefined. Consequently, validation always passes and my validation scenario is broken... I...

advice on best practice when connecting ASP.NET application to SQL Server

I have an ASP.NET application that uses the membership functionality. I connect to a SQL Server database that contains the aspnet_membership schema. I currently am using "sa" and the sa password in my application's connection string which, I know, is a horrible thing to do. My question is, what is the best alternative for the connection ...

Using variable from code behind in ASP.NET

I'm having a bit of difficulty setting a variable from the code behind and utilising it in the ASP.NET page (setting it as the value inside a textbox). My webpage simply errors and says it does not exist in the current context. The variable is declared and set all in the Page_Load method. Here is the relevant ASP.NET code. I assume you ...

How to get all img html on RenderChildren event

Hello, I'd like to know if it's possible to get a reference to all img controls on a page though the renderchildren method. Basically, I'm trying to seek the img tags to manually resolve their ~ path... This is the code I have so far... override protected void RenderChildren(System.Web.UI.HtmlTextWriter writer) { IterateControls(th...

GridView - using CSS-Friendly Control Adapters removes EmptyDataTemplate and EmptyDataText

As pointed out in the question: EmptyDataTemplate and EmptyDataText not working in GridView using CSS-Friendly Control Adapters removes the data that would would be populated by EmptyDataTemplate or specified in EmptyDataText in GridView. One of the solutions is to disable the addapters for GridView components as specified in this a...

ASP.NET: Custom subtags

Can I develop a control which allows me to do something like this: <MyRadioList> <MyRadioButton/> <MyRadioButtonWithInfoButton/> <MyRadioButton/> <MyRadioButtonWithBlueColor/> </MyRadioList> That is, I can place my own control-tags inside my radio list. Can it be done with templated user controls? ...

Possibly really stupid Web Farm Framework question

Hi all My apologies if this is a really stupid question, but I have installed and set up the new Microsoft Web Farm Framework in a UAT environment with a controller machine, a primary, and a secondary server. I have installed one of our in-house applications on to the primary server and it has been successfully provisioned across to th...

Updating objects in LINQ

I am trying to do an update in Linq. public myFunc(MyItem newItem) { using(var db = new myDataContext()) { var item = (from o in db.myTable where o.id == myId select o).First(); item = newItem; db.SubmitAllChanges(); } } This doesn't update the object, I guess item = newItem changes item to refer to the other. If ...

Silverlight, CGI, and the Debugger

I've got a Silverlight app that has to accept some initial data when it fires up. That data, unfortunately, MUST come from XML input. In addition, I can't just pass it through the URL because the actual request is coming from a server external to my own. So the basic setup is this: Remote server needs to launch my app. Remote server po...

Append custom value to IIS logs from ASP.NET

I would simply like to append an additional value which is generated at runtime in a page to my IIS log entry for the current request (or as an alternative, overwrite one of the standard fields with my custom value). I can't find a way to do this and I can't find an example of writing a custom log handler in C# (I'm not proficient in С...