asp.net

Dynamically adding controls in ASP.NET Repeater

I find my self having a repeater control which is being databound to an xml document. My client is now requesting that the Textbox's which are being repeater can be either a Textbox or a Checkbox. I cannot seem to find an easyway to essentially do the following: if ((System.Xml.XmlNode)e.Item.DataItem.Attributes["type"] == "text") <asp...

Retrieve Error text from SQL Server 2000 error

I need help logging errors from T-SQL in SQL Server 2000. We need to log errors that we trap, but are having trouble getting the same information we would have had sitting in front of SQL Server Management Studio. I can get a message without any argument substitution like this: SELECT MSG.description from master.dbo.sysmessages MSG IN...

LINQ: custom column names

UPDATE I'm basically binding the query to a WinForms DataGridView. I want the column headers to be appropriate and have spaces when needed. For example, I would want a column header to be First Name instead of FirstName. How do you create your own custom column names in LINQ? For example: Dim query = From u In db.Users _ ...

Is there a way to Categorize my custom controls in the toolbox?

I have built a number of asp.net servercontrols into a class library, & I would like them to be grouped a certain way when the other members of my team reference my dll. Is that possible? How? ...

Problem POSTing to webservice in .net 3.5 solution

I'm at my wit's end here. I'm trying to use an auto-complete extender from the asp.net ajax extensions toolkit, which is filled from a bog-standard webservice. The application is a .net 3.5 web site, hosting the webservice in a subdirectory (real, not virtual). Whenever I try to post to the webservice I get the following error: The HTT...

Menu control CSS breaks when inside UpdatePanel

I have a menu control inside of an updatepanel. When I hover over a selected item, and then move back off of it, the css class gets set to staticSubMenuItem instead of staticSubMenuItemSelected. Is there a fix for this? <asp:UpdatePanel runat="server"> <ContentTemplate> <asp:Menu ID="SubM...

AJAX.NET Reorderlist Control - "It does not a DataSource and does not implement IList."

I keep getting this error when trying to re-order items in my ReorderList control. "Reorder failed, see details below. Can't access data source. It does not a DataSource and does not implement IList." I'm setting the datasource to a DataTable right now, and am currently trying to use an ArrayList datasource instead, but am discourage...

Is this a proper way to get a WebProfile?

I have a user reporting that when they use the back button to return to a web page that they come back as a different person. It seems like they may be accessing a different users profile. Here are the important parts of the code: //here's the code on the web page public static WebProfile p = null; protected void Pag...

How can I make a framework for quickly building similar, but different, sites?

I have the need to build lots of sites that are very similar, but not exactly the same, using ASP.NET 2.0. I'm trying to find the best way to make generating these sites quick and easy. The sites will be used to collect information about a user, and there will be multiple steps for each site. The sites will all collect similar informa...

How do you handle attachments in your web application?

Due to a lack of response to my original question, probably due to poor wording on my part. Since then, I have thought about my original question and decided to reword it, hopefully for the better! :) We create custom business software for our customers, and quite often they want attachments to be added to certain business entities. F...

How do you RedirectToAction using POST instead of GET?

When you call RedirectToAction within a Controller, it automatically redirects using an HTTP GET. How do I explicitly tell it to use an HTTP POST? I have an Action that accepts both GET and POST requests, and I want to be able to RedirectToAction using a POST and send it some values. Like this: this.RedirectToAction("actionname", new ...

GetElementsByTagName functionality from .net code-behind page?

I am writing a webpage in C# .NET. In javascript there is a function called GetElementsByTagName... this is nice for javascript invoked from the .aspx page. My question is, is there any way I can have this kind of functionality from my C# code-behind? -- The scenario for those curious: I used an asp:repeater to generate a lot of but...

Passing Exceptions to an error screen in ASP.net/C#

Coming from a desktop background I'm not sure exactly how to pass the exceptions I have caught to an Error page in order to avoid the standard exception screen being seen by my users. My general question is how do I pass the exception from page X to my Error page in ASP.net? ...

Profiling SQL Server and/or ASP.NET

How would one go about profiling a few queries that are being run from an ASP.NET application? There is some software where I work that runs extremely slow because of the database (I think). The tables have indexes but it still drags because it's working with so much data. How can I profile to see where I can make a few minor improvement...

How to create a C# Login handler

How would I go about creating a web app login handler in C#? In Java I would use a JSP that posts the username and password to a servlet, which then delegates to a POJO - for the db lookup and validation. If validation fails the servlet forwards onto the login.jsp for another attempt, if successfull then forwards to the secure resour...

Dropdownlist control with <optgroup>s for asp.net (webforms)?

Can anyone recommend a dropdownlist control for asp.net (3.5) that can render option groups? Thanks ...

ASP.NET not seeing Radio Button value change

I have a form with some radio buttons that are disabled by default. When a value gets entered into a text box, the radio buttons are enabled via javascript. The user then selects one of the radio buttons and clicks on a submit button which posts back to the server. When I get back to the server, the radio button that user clicked is n...

config file syntax for configuring WCF Webservice Client Target EndPoint

What is the web config syntax for specifying a WCF WebService Proxy's Default Target Endpoint? Specifically, I'm trying to configure the address that the client uses for locating the .asmx of the webservice ...

How do I get the caller's IP address in a WebMethod?

How do I get the caller's IP address in a WebMethod? [WebMethod] public void Foo() { // HttpRequest... ? - Not giving me any options through intellisense... } using C# and ASP.NET ...

update page text using web user control

I am building an application where a page will load user controls (x.ascx) dynamically based on query string. I have a validation summary on the page and want to update it from the User Controls. This will allow me to have multiple controls using one Validation Summary. How can I pass data between controls and pages. I know I can def...