asp.net

.NET CheckBox control that supports Value property

I am aware that the default .NET CheckBox control doesn't support the Value property. This seems weird to me because the input control does support value as part of the html spec. So my question is whether or not anyone here knows of a custom user control out there for asp.net that acts similar to the standard ASP .NET CheckBox and Chec...

Difficulty in managing URL Paths

Managing url paths can be a real pain in ASP.NET. AbsolutePath vs RelativePath vs etc. drives me crazy. I find that many solutions require the user to edit web.config element to include the correct subfolder path; ex. Website Root: http://www.domain.com Web.config setting: / Website Root: http://www.domain.com/blog web.config setting...

gridview in asp.net VS2008

Have a gridview control and i want to display checkboxes for each row. The checkboxes should only appear if Session["DisplayBox"] == true. <asp:GridView ID="gridView" runat="server" AutoGenerateColumns="False" EnableSortingAndPagingCallbacks="True" AllowPaging="True" DataSourceID="JObjectDataSource" PageSize="5" OnRowCommand="gridVi...

MVC Routing - what number of routes will start to cause performance issues?

I am considering pre-loading routes to static content pages, allowing for n-depth nesting of content. I have a solution spiked that provides a bit of comfort in terms of the number of potential routes registered, but I'm wondering if I'm making the system overly complex. At what number of registered routes do you suspect a basic hosting...

How expensive is MD5 generation in .NET?

To interact with an external data feed I need to pass a rolling security key which has been MD5 hashed (every day we need to generate a new MD5 hashed key). I'm trading up whether or not to do it every time we call the external feed or not. I need to has a string of about 10 characters for the feed. It's for an ASP.NET (C#/ .NET 3.5) s...

Cache or class variables?

Is it better practice to use class variables, or the session cache in ASP.NET? I have a variable which I need to persist across page loads. Is it better to use: public class MyClass { private SomeObject anObject; private method1() { anObject = new SomeObject(); } private method2() { // do something with anObject } } ...

How to validate dynamically created control?

Hi all, I have an asp.net page, some of its controls are created dynamically, these controls are one of the following; textbox, calendar, or dropdownlist. These controls in some cases, should be validated based on flag read from db? Is there any way to validate dynamically created controls? ...

Visual Studio 2008 tries to convert a web deployment project every time I open the solution

I am using a web deployment project in Visual Studio 2008. Now, every time I open my ASP.NET web project solution which contains the web deployment, Visual Studio asks to convert the project (I guess from VS 2005 to 2008). I do the conversion and save, but if I close an re-open the solution, VS insists on trying to convert the project. ...

Web App Compiling Error - ASP.NET Reference

My current web app works fine locally and on live, what i am currently playing around with is compiling my Web App with the Visual Studio Option "Add Web Deployment Project" so all the code behind is compiled into DLL's. There's is one particular build error i can not get rid off Error 50 The type or namespace name 'usercontrols_calend...

File download dialog IE7 disappears

The following code will not run correctly in IE7 with the latest service packs installed. System.Web.HttpResponse response = System.Web.HttpContext.Current.Response; response.Clear(); response.AddHeader("Content-Disposition", "attachment;filename=Contacts.xls"); response.ContentType = "application/octet-stream"; System.Text.UnicodeEnco...

Mixing VB ASP.NET and C# ASP.MVC projects in a single solution

Background We are a TDD team who have inherited a legacy ASP.NET application and are trying to bring it under control by separating presentation, business and data access concerns and thereby improving testability. We have had some success using an MVP pattern for newly added pages but are investigating the MS MVC framework to see if it...

Postback destroys user controls in my GridView columns

I have a ASP.NET GridView that uses template columns and user controls to allow me to dynamically construct the datagrid. Now I'm implementing the event handler for inserting a row. To do that, I create an array of default values and add it to the data table which is acting as a data source. However, when my OnLoad event is fired on post...

Response.Redirect with Different Referrer

I've got the following piece of code in an aspx webpage: Response.Redirect("/Someurl/"); I also want to send a different referrer with the redirect something like: Response.Redirect("/Someurl/", "/previousurl/?message=hello"); Is this possible in Asp.net or is the referrer handled solely by the browser? Cheers Stephen ...

Run custom code on login

I’ve used the asp.net login control on my sharepoint custom master page. All works well and I can login to my site without problems. However I’d like to run some code once the user has logged, or alternatively perform a redirect based on the user’s role. Has anyone does this type of thing before? ...

Passing variables with AjaxPro

I found this AJAX .NET framework the other day, and so far I am enjoying working with it. However, one thing I can't figure out (the documentation is rather poor atm) is how to pass variables through the AJAX script. This is what I have so far: //default2.aspx.vb <AjaxPro.AjaxMethod()> _ Public Shared Function testSomething(ByVal ...

ASP.NET: Could anyone provide some C# paging codes in Repeater or ListView controls for me to learn. Thanks

ASP.NET: Could anyone provide some C# paging codes in Repeater or ListView controls for me to learn. Many many thanks.... ...

Dynamic Menu Build, need links in menu to open in a new window with specific characteristics.

Currently I am building a asp:menu control that will have various links to websites and applications for my users. What is available for each user is based on them specifically, so I build the menu using an xml datasource and then populate that xml from my database/stored procedure. I was able to add in this event to get the links to o...

Am I wasting my time by designing my ASP.NET components for WYSIWYG tools

A few days ago, I read a question asking how many developers hand code their HTML/XHTML rather than rely on the WYSIWYG tools - http://stackoverflow.com/questions/406052/do-most-web-programmers-not-designers-use-wysiwyg-editors-or-hand-code-their I tend to lean towards designing ASP.NET server controls rather than User Controls for use ...

Thread was being aborted when exporting to excel?

I have a DataTable which is bound to a GridView. I also have a button that when clicked exports the DataTable to an Excel file. However, the following error is occuring: ErrMsg = "Thread was being aborted." Here is part of the code where the error is being thrown: private static void Export_with_XSLT_Web(DataSet dsExport, ...

Access Non-Public members of a GridViewCommandEventArgs object

I have a gridview on my aspx page set up the OnRowCommand event using a series of ASP.NET LinkButton object to handle the logic using the CommandName property. I need to access the GridViewRow.RowIndex to retrieve values from the selected row and notice it is a non-public members of the GridViewCommandEventArgs object while debugging th...