I'm wondering if someone has a method for detecting whether or not a thread is running in a web environment.
HttpContext.Current
is not reliable because I'm making these checks in background threads where there is no HttpContext. It seems like
HttpRuntime.AppDomainAppId
is pretty reliable (if it is null then I'm not in a web app), ...
I am currently working on a website which allows a prospect to generate a quote and purchase a policy. After they submit their payment the application should generate a policy number.
I was given a block of policy numbers to use incrementally. For this example, let's say 0100800 - 0100999. If I have two or more people who decide t...
I have an SQL Data Source which selects all rows of a table. I need to populate a dropdownlist with a certain field ('percentage') of all the rows, and when one is clicked to make the 'value' the rows 'id' field.
Is there a simple way of doing this? Thanks
...
Tearing my hair out here trying to implement a pretty simple form inside a .NET page.
The form looks like this:
<form action="http://domain.com/subscribe.tml" method="POST">
<p><input name="email" type="text" /></p>
<p><input type="image" src="/images/ui/btn-getfreereport.gif" alt="Signup" /> </p>
<input type="hidden" value="one_he...
We have an ASP.NET web site that uses SQL Server session state. The state is configured in Web.config like:
<sessionState mode="SQLServer" sqlConnectionString="data source=TheServer;
User ID=TheUser;password=ThePassword;" cookieless="false" timeout="480"/>
But there are three environments (development / staging / production). Al...
Long story short, I would like to take my usercontrols that are loaded dynamically and stick them into a list that references the actual object that has been loaded. So I can go into the list and pull results from the usercontrol. I would like to use mycontrol.GetResult() and it will then reference the control and grab the results from t...
If I pass the derived class testA a PlaceHolder that contains a Hyperlink, with a url that starts with
a tilde, it resolves it correctly.
However, when I pass testB
(identical apart from it inherits from
System.Web.UI.UserControl) the same PlaceHolder It
renders it literally (doesn't
transform / resolve the '~')
Any ideas?
publi...
can anyone help me with the length of maximum characters that can be contain in a normal HTML text box....
...
I have an AutoCompleteExtender in my ASP.NET which works great so far. I have a few little niggles I'd like to sort out though:
1: Is there a way I can limit the user to only being able to select an item from the list, and not use their own text? So they can't search for something that isn't autocompleted.
2: Is there a way to always h...
I wish to return the following output
<a href="#"><img src="/images/icons/tick.png" alt="" />More info</a>
If i do the following the content is html encoded.
<%= Html.ActionLink("<img src='/images/icons/tick.png' />More info", "OrderRegion", "Campaign", new {id = Model.Campaign.Id}, null) %>
How can i disable the html encoding?
...
Hello,
I am using Visual Studio 2005 and IIS 6.0.. I have this warning in the event log. I am trying to find what it is. I have never went through this exception when i am working.
What can be done and where can be done to not get the exception warning again. Thanks so much in advance!!
Event code: 3005
Event message: An unhandled exc...
I'm using NHibernate to map the following class to an Oracle database in my ASP.NET MVC application:
public class User
{
// Needs to be encrypted/decrypted when persisting
public virtual string Question { get; set; }
}
Following several examples that I've found, I would like to use an implementation of NHibernate's IUserType t...
Hi all,
I'm trying to format the following:
<%# Bind("TimeOfDay","{0:HH:mm:ss}") %>
<%# Eval("TimeOfDay","{0:HH:mm:ss}") %>
<%# Bind("TimeOfDay","{0:HH:mm:ss tt}") %>
But using either of those returns time as following:
08:33:08.1430000
How can I only get the 08:33:08 part?
Thanks,
EtonB.
...
I want to provide some dynamic content like an rss feed, so when they go to mydomain.com/fishcake.rss it runs some code on the server to generate it and returns it back.
I am guessing maybe an ashx file and something in the webconfig to associate it with the path I want, but I'm not totally sure. Can you help?
...
I've built this app that displays employee photos stored in several sharepoint folders. It also displays the employee name extracted from the file name and a previous and next button to move through the photos.
The markup is surrounded by an update panel to prevent the entire page from reloading when you click to view the next photo.
...
How do you back-door authenticate Windows users into a website using forms authentication running on IIS 7.0?
...
I have this code
public List<CalendarData> GetCalendarData(DateTime day)
{
List<CalendarData> list = new List<CalendarData>();
using (dataContext = new VTCEntities())
{
DateTime test = new DateTime(2010, 10, 20, 17, 45, 0);
var data = from z in dataContext.ReservationsSet
...
I've upgraded a VS 2005 app to VS 2008, and tried to run it. I get some very strange behavior. Something, I don't know what, comes up and says:
"Unable to start debugging on the web server. <!DOCTYPE html PUBLIC "-//W3C/DTD XHTML 1.0
Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
<html xmlns="http://www.w3.org/1999/xht...
Is there any way to localize the text displayed within the PropertyEditorPart?
[Personalizable(true),
WebBrowsable(true),
WebDisplayName("To Date: "),
WebDescription("Please enter To Date value.")]
public string ToDate
{
get { return toDate; }
set { toDate = value; }
}
...
I really know very little about regex's.
I'm trying to test a password validation.
Here's the regex that describes it (I didn't write it, and don't know what it means):
private static string passwordField = "[^A-Za-z0-9_.\\-!@#$%^&*()=+;:'\"|~`<>?\\/{}]";
I've tried a password like "dfgbrk*", and my code, using the above regex,...