asp.net

Ajax toolkit ModalPopupExtender drag&drop returns to original position

When I drag the popup over the page and release it, it's returned some times to it's original position. Depends where I drop it... Is it possible to freely move it over the page? ...

ASP.Net MVC Html.Label with Attribute List?

How do I create an ASP.Net MVC Helper for an Html.Label which takes in attributes? Currently when I define an Html.TextBox I am able to pass in a list of attributes. Sort of like below: new {disabled="disabled", @class="pcTextBoxWithoutPaddingDisabled"})%> However, it does not look as though the Html.Label has this feature. As a r...

asp.net 3.5 linq batch update?

Hi Looking for a bit of advice on this. I have a fairly robust .net web app where up till now ive only had to deal with records (in a sql server database) one at a time. I now have a requirement to do a batch update, of probably around 100 - 200 records at a time. I prefer using LINQ for querying, I know its not the best but just throug...

Porting old pages to use masterpages

I have hundreds of legacy webform pages adding header and footer via a BasePage overriding Render protected override void Render(HtmlTextWriter writer) { RenderHeader(writer); base.Render(writer); RenderFooter(writer); } New pages uses a MasterPage for the default behavior. I would like to know if ...

How does digg /facebook get the title of the page and the thumbnail of the image of the link when posted?

How does digg/facebook get the title of the URL posted and the thumbnail of the page in facebook/digg. Can someone explain, how it can be achieved in asp.net or asp. Thanks ...

Web.Config Error using Web Application

Hi, I use this Web.Config file. If I use Web Site Administration Tools as "Web Site" all is working great. If I use the same script as "Web Application" I receive and error in tab "Security". Error: "There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permiss...

Is it appropriate to use Microsoft.Practices.EnterpriseLibrary.Caching with ASP.NET?

Working on a legacy ASP.NET application we've found that ASP.NET session gets used for caching some objects, but for some objects Microsoft.Practices.EnterpriseLibrary.Caching gets used. Is there any reason to use Microsoft.Practices.EnterpriseLibrary.Caching over standard ASP.NET Session? Edit In my scenario, the Enterprise Library c...

Add reset to defaults button to asp form but avoid postback

I have a couple of fields on a form that will be populated with default values. I would like to put a button that will allow me to reset those fields to their default values if they have been modified. However I would like to avoid the postback so that I don't have data being sent to the database. Is it possible to add a javascript hook...

Retrieving "system.webServer/security/authorization" configuration with Microsoft.Web.Administration API

Hi! I'm trying to use the Microsoft.Web.Administration API to access the 'system.webServer/security/authorization' section (at the current request path) to see if anonymous users ("*") can access. To do that i'm trying to access the section configuration by: WebConfigurationManager.GetSection(HttpContext.Current, "system.webServer/sec...

GZipStream is cutting off last part of XML

I have created an extension method called AddGZip which looks like the following: public static void AddGZip(this HttpResponse response) { response.Filter = new GZipStream(response.Filter, CompressionMode.Compress); response.AppendHeader("Content-Encoding", "gzip"); } This is a very cut down version of the code: var response ...

Why assembly namespace coming twice?

I am calling my business layer project in Web Project. I added refress business layer project to Web. When I call class in BL project, I need to write twice this namespace. I dont know why it is coming. MyCompanyName.HRHead.DataLayer.MyCompanyName.HRHead.DataLayer.User I suppose to call MyCompanyName.HRHead.DataLayer.User In my BL...

How to disable security for an Action in ASP.NET MVC?

My requirement is that only the login page and the Register page should be accessible from anonymous users. I have created a new ASP.NET MVC project using the default template in VS2008. After that I have enabled security adding this section to the web config: <authorization> <deny users="?" /> </authorization> Now t...

Help writing regular expression for validation in asp.net mc 2

I need my users to input very specific cell phone format cause my app will be sending sms to them So, I need their cell phone formats to be like this 04AB-XXXXXXX Where A can be either 1 or 2 and B can be either 2, 4 or 6 X can be from 0-9 There must be exactly 7 numbers (X) after 04AB It must always start with 04 Examples: ...

Asp.net Generic Handler Encoding Problem

Hi everyone, My problem is not too hard but really annoying. I'm sending values to Generic Handler via Ajax like that way. xmlHttpReq.open("GET", "AddMessage.ashx?" + (new Date().getTime()) +"&Message=" + Message,true); when message contains İ,ç,ö,ğ,ü,ı they are looking like that on Handler ������� In context.Request.RawURL İ,ç,ö,ğ,ü...

How do I code my ASP.NET page to parallelize downloads across hostnames?

Google Page Speed test tells me I need to distribute my queries across DNS Domain names to speed up rendering. Since I do development offline, I'd like to find a solution that will distribute my static content (img, CSS, js) across different hostnames, and will still work when I'm offline in an airplane. Q: How can I code my page to u...

ASP.NET - When to use custom exceptions?

Hey there, I keep hearing over and over again that I should ALWAYS use custom exceptions in my web apps.. The problem is that I dont see any reason for making custom exceptions when they all are handled in the global.asax(write to database etc.) anyway.. So why should I use them? ...

Visual Studio 2010: How to enforce build order of projects in a solution?

Hey all, I had no problem with this in Visual Studio 2008 but it seems that VS 2010 is having an issue, and I'm betting it's probably me. I have a solution with an ASP.NET Web Site Project and a few C# projects (BLL, DAL, Tests in NUnit). I have configured the build process for the test project to automatically run NUnit to run the tes...

In VB.NET, how do you override a function and call a function with the same name from the grandparent superclass?

I am attempting to inherit an ASP.NET RegularExpressionValidator and add some functionality to it. I inherited the control and added my custom properties. However, I would also like the client-side functionality to call a different JavaScript function. In order to do that, I will need to supress what is happening in the AddAttributesToR...

ASP.NET Repeater question

Hi guys, I have a repeater control and under the ItemTemplate, I have Image control. Anyway the old How can I set the ImageUrl programatically? Anyway, the old html code I have was like this: <ItemTemplate> <img src="<%# Eval("ImageSource") %>" alt="" /> </ItemTemplate> But I want to check if the image exists in directory or n...

What type of pattern do the Web User Controls in ASP.NET fall into?

I'm just curious to know what type of pattern do the Web User Controls in ASP.NET fall into? ...