asp.net

is it possible to delete from 2 or more sql tables using a sql datasource?

I am getting an FK error when i am deleteing a row from my datagrid because i cant see a way to delete from the oher table where the FK is then the main table? i am getting this error: The DELETE statement conflicted with the REFERENCE constraint "FK_Availability_Fixture". The conflict occurred in database "Rugby", table "dbo.Availabil...

System.Web.dll references System.Windows.Forms?

I heard from a friend that asp.net relies on/uses a Windows forms class. I tried to figure out which class that might be. The only class I found was System.Web.UI.WebControls.FontInfo with the property public string[] Names that has an Attribute Editor("System.Windows.Forms.Design.StringArrayEditor--snip") Is there a reference to the...

Adding a post-build event to a web site in Visual Studio 2008

I am using a "web site" in visual studio 2008, and i would like to add a post-build event which would append the build time to the web.config file. Is it possible? ...

AJAX Toolkit AutoCompleteExtender with a *PAGE* service?

Hi - I have an application currently using the AJAX Toolkit AutoCompleteExtender to extend a textbox. It is using a webservice to select and retrieve the data. The docs for the toolkit say that you can also use a page service and I have been trying for days to get that to wrok - both in the vs2005 and the 2.0 framework version and vs20...

Cycle through controls in UpdatePanel, and access javascript

I'm trying to update all TextBoxes on my page to convert them to labels like so: foreach (Control ctrl in masterform.Controls) { if (ctrl.GetType() == typeof(TextBox)) { TextBox t = ctrl as TextBox; t.ReadOnly = true; t.BackColor = transparent; t.BorderWidth = 0; } } Unfortunately, I encompa...

Gridview Sorting With Images

Hi, I have a web app(ASP.NET 2.0 with C#), and in it I have a gridview that gets its data from an oracle database. I needed to implement the sort function for the gridview, so I added a dropdownmenu right above the gridview with 2 choices: Ascending and Descending. Then in the Gridview_Sorting method, I have a switch statement that ba...

How to deal with link redirects when migrating from classic ASP to ASP.NET?

I have a large-ish web project which is migrating from classic ASP to ASP.NET (about time), and would like to redirect requests from the old addresses, such as: /some/path/old-page.asp?foo=bar to the new addresses: /other/path/new-page.aspx?qaz=bak For a fairly long time, there will be classic ASP pages running in parallel wi...

Implementing clickable page numbers in search result

Classic scenario: Take user input, get a search-result and display it in pages to the user. I then need to display buttons for First, Next, Previous etc, and I maintain the users current page in viewstate. All is good, works fine. Then I need to implement clickable page numbers, ie. 1-2-3-4-5-6 etc. Rendering them is simple. I generate...

Setting a master page's master page programmatically

Is there anyway to set a Master Page's Master Page programmaticly? Would I need to do this on each page? I don't have access to the pre_init event from Master. Hrm... ...

How to register events for postback with RenderControl?

I am using RenderControl in a string builder to add a dropdownlist in a asp:TreeView. My dropdownlist is set to autopostback and I have an event on the SelectedIndexChanged attached. Unfortunaltly, I see my dropdownlist correctly populated inside my treeview, but changing the selection ain't raising events. here is my code : DropDownLi...

System.Windows.Forms in asp.net 3.5

I'm trying to implement a website screen shot class as described here http://www.plentyofcode.com/2007/09/website-screenshot-capture-with-aspnet.html The class imports the following methods Imports System Imports System.Drawing Imports System.Drawing.Imaging Imports System.Windows.Forms Imports System.Diagnostics Namespace GetSiteThum...

What happens to viewstate in a text/plain page?

Let's say you have a page that produces text/plain output. If you set the ViewState in Page_Load, it doesn't do anything to the output (which makes sense). My question is, does text/plain turn off ViewState processing? What does ASP.NET do to decide when it'll turn things off? ...

Pre render event in asp.net

protected void rgStateTax_PreRender( object sender, EventArgs e ) { if( rgStateTax.MasterTableView.IsItemInserted ) { foreach( GridItem item in rgStateTax.Items ) { item.Visible = false; } } if( rgStateTax.EditItems.Count > 0 ) { foreach( GridDataItem item in rgStateTax.Ite...

Apply an ID to a GridView

Before you say it, I'm perfectly aware that a data repeater could do it, but I'm looking for the solution using a GridView. I'm implementing a jQuery feature and require unique ID's to be applied to individual rows in order to respond to click events in the correct manner. I can't see how you're supposed to apply values to an ID or a r...

Which metrics are most useful in an ASP .Net build server?

I'm just wondering what metrics people measure on a build server. I'm setting up a build server for a series of asp .net 2.0 projects. On the server I'm currently measuring: Unit test code coverage. Build and test run time. LOC (just out of idle curiosity). Cyclomatic complexity. Some FxCop rules. What do you measure and how do you...

What is the best way to log exceptions in Visual Basic, on an ASP.NET Application ?

I'm working on an ASP.NET web application, written using Visual Basic, and I'm trying to track down an error message that I'm getting. I'd like to get it to log the exception to a file (or the event log) so I can see it, as the error only occurs on the production server, and not on the development environment (therefore VS isn't instal...

ASP.NET: Multiple Session objects in a single application

I have one ASP.NET web application running at the web server root which provides multiple (similar) web sites by using URL redirection. To give a real world example: http://webshopserver/company1/ProductList.aspx -> http://webshopserver/ProductList.aspx?showProductsFrom=company1 http://webshopserver/company2/ProductList.aspx -> http://w...

Set asp:Content programmatically

I'm using a asp.net web application project, and I cannot access any asp:content controls programmaticly. I'm trying to update its contentplaceholderID in code behind. Is this possible? Thanks ...

Problem getting commandeventargs in command event following re-creationg of controls in postback

I am haveing problems getting the command event args following the second click using the code below. so - when i process a button click, and generate a new button to replace the one that was there i lose the viewstate on the next button click. Any suggestions on what I need to do to get this to work? I cannot significantly change the ...

LINQ to SQL partial class OnValidate Changeaction.Delete

OK here's my problem... I have a LINQ partial class: public partial class resp { public IEnumerable<RuleViolation> GetRuleViolations() { if (String.IsNullOrEmpty(respName)) yield return new RuleViolation("Responsibility name required", "respName"); yield break; } public bool IsValid { ...