asp.net

What is the App_Data folder used for in Visual Studio?

When creating a new ASP.NET application in Visual Studio, a couple of files and folders are created automatically. One of those folders is called App_Data. Also when publishing a website by selecting the menu option Build->Publish a checkbox is available Include files from the App_Data folder. Am I right assuming that the files put in ...

Raising events from a dynamically loaded user control.

I dynamically load a UC in the Oninit of the host page. In the Oninit of the UC, I raise an event. I get a null reference exception. The code is as below: //In the UC public event CommandEventHandler DoneProcessing; protected override void OnInit(EventArgs e) { //Raise a event CommandEventArgs cmdEventArgs = new CommandEv...

Positioning Columns With Absolute Positioning Instead of Floats

Hello All, I have read several articles regarding templates for web site content. They all seem to recommend that the columns should be placed on your site via floats. Example: <div id="container" style="width: 1000px;"> <div id="main_content" style="border: solid 1px Black; width: 798px; /* width = 800px -2px for border */ floa...

Can someone explain why this happens in dynamically loaded UCs?

I got this working by trial and error but would really appreciate an explanation. Summary: I am dynamically loading usercontrols from the host page. Host Page .aspx OnInit does a LoadControl and loads the control User control .ascx On Page_Load -> First time load --> I set a value to a hidden input type variable --> I set a ...

ASP.NET MVC design

As I've stated before I'm working on a digg clone to teach myself ASP.NET MVC Inside and out but I've hit a road bump that I can't seem to avoid. I want to be able to optimize this application as much as possible so I have my DAL which is a bunch of classes of ...Repository : Repository. Now to help optimize for performance I have my b...

ASP.NET Client Side Postback

I have your basic asp.net web form which contains some client-side JavaScript that forces the page to time out and then redirect after 5 minutes. Mainly to protect possibly sensitive information. At timeout, I want to force a server post back allowing me to save the form values for future edits. I have played with both ClientScript.Get...

How do I change a windows password through asp?

I have a web application that uses Integrated Windows Authentication to validate users. Most of them are remote and don't have access to a workstation to update their AD password. Rather than manually managing passwords my self, I'd like to put together a script so they can change them on their own. How would I update their windows pas...

Importing a Json String

I am attempting to import a Json string by using: AreaField areaField = new AreaField(); areaField = (AreaField)JsonConvert.Import(typeof(AreaField), HdnData.Value); The class definition is as follows: public class AreaField { public List<AreaFieldItem> AreaFieldItem { set; get; } } public class AreaFieldItem { ...

HttpContext.Current is null

I am doing some asynchronous work on a separate thread using: ThreadPool.QueueUserWorkItem(...) and in this separate thread, I need to call HttpContext.Current so that I can access: HttpContext.Current.Cache HttpContext.Current.Server HttpContext.Current.Request however, HttpContext.Current is null when I create this separate threa...

VB.NET Tracing Variables

I'm working on an approach to trace logging for my company's VB.NET project. The .NET framework has pretty versatile trace capabilities and I'd like to use what .NET already provides. My company wants to stay away from 3rd party software, so log4net and whatnot is out of the question. They want to be able to trace the flow of the web ...

What's the property way to transform with XSL without HTML encoding my final output?

So, I am working with .NET. I have an XSL file, XslTransform object in C# that reads in the XSL file and transforms a piece of XML data (manufactured in-house) into HTML. I notice that my final output has < and > automatically encoded into &lt; and &gt;. Is there any ways I can prevent that from happening? Sometimes I need to bold or i...

How can i remove item from querystring in asp.net using c# ?

Hi, I want remove "Language" querystring from my url. How can i do this ? (using Asp.net 3.5 , c#) Default.aspx?Agent=10&Language=2 I want to remove "Language=2", but language would be the first,middle or last. so i will have this Default.aspx?Agent=20 ...

Redirect additional domains to main .com domain using IIS7 URL Rewrite Module

How should I configure the URL Rewrite Rule in IIS7 to redirect my aditional domains ( domain.net, domain.org, domain.info) to the principal .com domain? ...

Need a smaller alternative to GUID for DB ID but still unique and random for URL

I have looked all of the place for this and I can't seem to get a complete answer for this. So if the answer does already exist on stackoverflow then I apologize in advance. I want a unique and random ID so that users in my website can't guess the next number and just hop to someone else's information. I plan to stick to a incrementing ...

Ampersands in URLRewriter Query Strings

I have a query string parameter value that contains an ampersand. For example, a valid value for the parameter may be: a & b When I generate the URL that contains the parameter, I'm using System.Web.HTTPUtility.UrlEncode() to make each element URL-friendly. It's (correctly) giving me a URL like: http://example.com/foo?bar=a+%26b The...

How do I redirect with a Drop Down List, and not a Button?

I am looking into using only a ddl to run my query, not a ddl and a Button_Click function. I am yet to find what to do. How do I do this? ...

Check if object is NOT of type (!= equivalent for "IS") - C#

This works just fine: protected void txtTest_Load(object sender, EventArgs e) { if (sender is TextBox) {...} } is there a way to check if sender is NOT a TextBox, some kind of an equivalent of != for "is"? Please, don't suggest moving the logic to ELSE{} :) thank you. I knew it had to be easy :) ...

ASP.net application can't connect to sql server 2005 database.

Here is the scenario: IIS 6 and SQL Server 2005 on same machine: I have just created a new application inside of my main website in IIS. The root website has its own database. The application I just created under the root site has its own database, as well. ASP.net pages in the root site connect to their database using trusted securi...

Best practice - MOSS 07 and Javascript Files?

What are the suggested methods for using javascript files with MOSS 2007 ? in the 12 Hive somewhere or directly in the site's virtual directory in a scripts directory ? Or possibly as a embedded resource in a webpart ? ...

Is WCSF for me?

I have a 3-man .NET web shop. Over the years we've developed a number of tools for content management, blogging, e-commerce, social network, and so on. We've never really modularized the software, though; so that porting functionality from one site to another is labor-intensive (we typically just copy and paste bits of code and other ass...