asp.net

How to Send Status Updates to the User during Partial Update

I have the following: Master Page StatusDisplay - Ascx user control that shows MS AJAX Exceptions on PartialPostback or Update Happenning during beginRequest to endRequest Pages with Multiple levels of .ascx Web user controls, some loaded dynamically Currently, when postback happens in Update Panel, the StatusDisplay shows "updating ...

ASP.NET / C# How to access list item of unordered list with runat=server ?

Hi, I have a ul list with a number of list items like: <ul> <li runat="server" id="liOne">one</li> <li runat="server" id="liTwo">two</li> <li runat="server" id="liThree">three</li> </ul> On page load, I need to set these list items visible or not visible. For some reason I cannot access these in the C# code behind. Nor are the list...

Fluent NHibernate with development/test/production databases?

I was wondering if anyone had developed an approach for using NHibernate / Fluent NHibernate with different databases depending on the application's configuration (similar to Rails' development, test, and production databases). I believe I could get something working by using methods with conditional attributes, but I would be intereste...

Bulk Editing of A GridView in ASP.Net

What is the best way to achieve bulk editing of a grid view in ASP.net? I don't want the user to have to click edit on each individual row to change it. It would be much better if they could make all the changes and then submit them in one go. What I want is something like Item1 x x x x Item2 x x x x Item3 ...

Type.GetType(string) using "Generic<T>" syntax?

I'm building a generic ASP.NET server control that has an attribute used to specify a type name. I'm using a control builder to generate the generic version of my control by passing the attribute value to Type.GetType(string). This works great. However, if the type that I want to specify is generic, I have to use syntax like this: <gwb:...

Is there any way to overload extension methods in C#?

I have the following Model pattern: public abstract class PARENTCLASS {...} public class CHILD_A_CLASS : PARENTCLASS{...} public static class EXTENSION{ public static METHOD(this PARENTCLASS parent){...} public static METHOD(this CHILD_A_CLASS child) {...} } Something like above, of course there will be more child (and grandchild)...

How to style nested panel controls in ASP.NET

Hello all, I have a panel sitting in a div, and I want to use that panel as a container to add more panels! Why would I want to add a panel to a panel? Because the panel that I'm adding to the existing panel, is also made to contain objects, but only and image and label. The existing master container panel is created during design time...

Testing for Flash capability on the server-side

I'm developing an ASP.NET website that will need to support non-flash users. In case the user's browser doesn't support Flash, or they have Flash disabled, I'd like to download a large splash image to the browser. However I don't want to waste bandwidth downloading it if the Flash does render properly. So is it possible to test, from ...

DataKeyNames with subclassed property?

Is it possible to set a DataKeyNames property in a gridview/listview to a subclassed property? For example if I have a Product business object that has a Category object as a property... DataKeyNames="ProductID, Category.ID" doesn't seem to work. ProductID alone works fine. A hidden field with #Eval("Code.CodeName") works but DataKeyN...

Simple File Download Counter with ASP.NET ?

How can O make a simple file download counter with ASP.NET in C# ? For example when a user clicked and download file i wanna update it with +1 and save it's filename to DB. when user onmouse over link i wanna shows a tooltip with File Downloaded Times.But If user Cancel downloading status it wont update it . ...

Is there any Web RichTextBox Control that supports RTF format?

I'm working on an application that let's people send messages to each other.We have a win application and a web application.So far we are using a RichTextBox control in our windows application that let's people format their text and it's saved as a RTF text in our database.The problem is we don't have such a control in our web app but a ...

Problem removing codeSubDirectories elements in sub-application

I have an ASP.NET application with a <codeSubDirectories> section in web.config. My main project is in VB.NET but I have a CSCode subdirectory under App_Code written in C#. Now for every new sub application I create I have to create a CSCode folder under App_Code. Microsoft's documentation says there is a <clear /> element but I get a...

DropDownList in FormView binding

I want to bind dropdownlist to List<MyIem>, in code behind. <asp:DropDownList ID="listCategories" runat="server" Height="20px" CssClass="CategoryDropList" SelectedValue='<%# Bind("ParentId") %>' AutoPostBack="false" Width="300px"> Without using ObjectDataSource ! How can I Bind it to the dropdown list? In what event? Also the S...

Container.DataItem works in C# not in VB.NET

This line of code ((Matches)Container.DataItem).MatchID works in C# but in VB.NET, when used in a Repeater, I get the error 'Matches' is a type and cannot be used as an expression. Suggestions? ...

Return Enumerable value from Class in linq?

i need Enumarable value from below class but give error public static Enumerable LoadDataByName(string name) { List<StuffDepartman> Stuff = (List<StuffDepartman>)HttpContext.Current.Session["Stuffs"]; var stuffs = from s in Stuff select s; stuffs = from s in Stuff where s.Name = name s...

ASP.NET: avoid RequiredFieldValidator on navigate button postback

Hello! I have an ASPX page with two RequiredFieldValidator and a button to go to another page. This button must do a postback to know where to go. This button can be clicked it any time. The problem is that the RequiredFieldValidators are not disabled and show their message asking for a value. Is there any way to avoid validation when...

Why does the runat-attribute in the head-tag change the way meta tags are handled in ASP.NET?

Example 1: <head> <meta http-equiv="description" content="<%= Foo %>"/> </head> Renders <meta http-equiv="description" content="Bar"/> Example 2: <head runat="server"> <meta http-equiv="description" content="<%= Foo %>"/> </head> Renders: <meta http-equiv="description" content="&lt;%= Foo %>"/> Note the discrepancy, the <...

Versatile ASP.NET CMS in C#

We are making a public website on ASP.NET and we are looking for a really versatile CMS that will give us enough freedom and allow us to create not only standard content pages (a feature which all CMS offer), but also pages with custom ASP.NET programming. Imagine the following case: our site will contain several custom ASP.NET pages pr...

how can I read an xml attribute using readXML? how does dataset.readxml translate into tables?

I just want to know how does the table resulting from readXML look like, say if the xml file looks like this: <item attr="some attribute"> <descirption>anything</description> </item> I can reference tables directly by the Tables collection like this: ds.ReadXml(xml); ... ds.Tables[i] then I can access rows and columns using the row...

ASP.NET Response.End Problem

hi , i got a page users downloading files from there.And when a user click download link and finish downloading file , i am insertin' a new record for my File Download Counter event. (FileID,Date,blalbla..) But there is problem with my script ... after download starts and finish, its adding a new record but after this, its fires event...