asp.net

Html label tag and ASP.NET

What is the best way to use the <label> tag within an ASP.NET application? I want it to be XHTML valid, accessible and usable. I understand the optimal way is this: <label for="Username">Username:</label> <input type="text" id="Username" runat="server" /> But if the above code is in an ASP.NET user control, the input ID will change, ...

Where to find or duplicate code that produces HttpRequestValidationException

I have some PageMethods (static methods in a page marked with <WebMethod>) defined on some pages and call them using an ajax call. This POST to the server apparently doesn't trigger the ASP.NET code that would raise HttpRequestValidationException if the data sent is deemed possible XSS, so I'd like to duplicate that checking code to run...

Databind Function to Controls Visible Property Does Not Work

I'm using databinding to set the visible property on a control as such: Control on Page: <asp:LinkButton ID="ApproveTimeLink" runat="server" Visible="<%# CanApprove() %>"> Approve Time</asp:LinkButton> Code on CodeBehind: Protected bool CanApprove() { return false; } As you can see the control should not show, yet still does....

Looking for a .NET library to do authentication that support multiple sources.

I'm looking for a suggestion for a .NET library which can allow me to use in an ASP.NET application so that I have one profile for each user, but can associate authentication from multiple sources including: ASP.NET Forms based, windows live id, google, facebook, openid, etc... I want people to come to my website and be able to associate...

Can ASP.NET Impersonate a user to Delete a Performance Counter Category?

I believe that I have successfully impersonated my own user account while running an ASP.NET page on my local machine. Using the method described here, I have successfully changed the WindowsIdentity.GetCurrent().Name from ASPNET to my domain account. I can successfully write to a file on the file system that ONLY my account has perm...

jQuery and ASP.NET - forcing button click

I have a ASP.NET page which has a form on it. It also has a search form on it. The search is in the top-right of the page, so the button for the search is the first added to the control hierachy. When you're working on the other form and press enter it will click on the search button. I don't want this, I would prefer that when you pres...

What Project Layer Should Screen DTO's Live In?

I have a project where we use screen DTO's to encapsulate the data between the Service Layer and the Presentation Layer. In our case, the presentation layer is ASP.Net. The only classes that know about the DTO's are the service layer classes and the Pages/Controls that call these services and display the DTO's. The DTO's are almost alw...

Check all radio controls with a specific substring on an ASP.NET form

I'm working on a .NET-powered questionnaire which contains several repeater controls, each row of which contains three radiobuttons. I'm trying to write a simple Javascript function to check all the controls on the page which contain the word "chkGreen" in the control name/id. The page looks something like this: Repeater 1 Description ...

How to sort controls at runtime in ASP.NET

How to order Controls at runtime in ASP.NET for instance I have three text boxes in my web page in the following order textbox1 textbox2 textbox3 I want the order of these controls to be changed depending on the user preferences textbox3 textbox2 textbox1 that is just an example, any idea? ...

Creating an AJAX Script Control

Call me a 'n00b', but I am new to creating Script Controls. I want to create a simple control with 3 text boxes. I have a .cs file that looks like this: public class SmokingCalc : ScriptControl { public SmokingCalc() { Render(htmlWriter); } protected override void Render(HtmlTextWriter...

What happened to SetAttemptedValue in ASP.NET MVC RC?

I don't know what to use in place of it? ...

visual web developer resize "all images" together?

I have a weird problem with images in visual web developer, I cant change my images properties from properties panel (my changes don't take effect) and all images in my website have gotten the same size when I resize one image (by dragging the border), all images get that new size? any idea? ...

Visual Studio 2003 - opening ASP.NET project - getting "The operation timed out" error message

Occasionally, when I open a visual studio 2003 ASP.NET project it seems to spend forever loading up then finally displays the following error message: "The web server reported the following error while attempting to create or open the web project located at the following URL: http://localhost/myprojectname. The operation timed out." An...

How to get a reference to a control from its' string name in C#

How to get a reference to a control from its' string name in C#? ...

ASP.NET: An editable data bound control in every record?

We need to display the result of an SQL SELECT statement on a ASP.NET 3.5 web page. Although there are a number of columns that need to be displayed, only one of the columns needs an editable text box in it... however every record in the result set needs this editable textbox. I know I can do this manually by building an html table myse...

Safe to remove unused ASP.NET membership tables?

I'm going to be using the ASP.NET Membership model on my website. However, there are multiple tables that I do not plan to ever use, such as: aspnetPaths aspnetPersonalizationAllUsers aspnetPersonalizationPerUser aspnetProfile aspnetWebEventEvents Is it safe to delete these tables or will I cause problems with the way ASP.NET's membersh...

Making Articles Website

[ Edited Version ] Note : I don't want to use open source CMS , and want to write my own here , This is a Designing Question [ The question at first wasn't vague like this , because I wrote a numbered , styled , step-by-step question , but I don't know why the site didn't add the question , I shocked ! , and this question is a vague ,...

How do I reference an ASP.net MasterPage from App_Code

I'm working on a .net 3.5 site, standard website project. I've written a custom page class in the sites App_Code folder (MyPage). I also have a master page with a property. public partial class MyMaster : System.Web.UI.MasterPage { ... private string pageID = ""; public string PageID { get { return pageID; } ...

How to stop a 500 .net error created calling the 500 error page

Here's an interesting one for you. I've got my custom 500.aspx setup which is called when a 500 error occurs in my application. The 500.aspx also sends me an email with the error details. I've noticed one small problem. If you attempt an xss attack on the 500.aspx itself, the 500 page is not called. This is obviously some sort of log...

Why is the footer-item not included in Repeater.Items?

I need to get a value from a textbox inside a FooterTemplate in the OnClick event of a button. My first thought was to loop through the items-property on my repeater, but as you can see in this sample, it only includes the actual databound items, not the footer-item. ASPX: <asp:Repeater ID="Repeater1" runat="server"> <ItemTemplate> ...