asp.net

Having seperate themes - if the same host address has www. and a version with no www.

I have a set of themes for my website, which are to be used with different requests from different urls. So if the url = www.xyz.com I load a different theme, as opposed to www.abc.com. However, I have tried having a theme called www.abc.com and a theme called abc.com, and in my webform codebehind I have a preinit page event which says ...

log4net - want to create a log file per web application user

We are using log4net (replacing nLog) in our Asp.Net web application. nLog had a useful feature that would allow us to create a log file per user - which is helpful for organizing and locating the log statements. Does anyone have any ideas on how to do this with log4net? ...

ITemplate and DataGrid Column in Codebehind

I have a situation where I need to work with a datagrid and adding columns dynamically in PageInit as the grid has a few conditional requests that it must handle. I'm moving along easily with BoundColumns, and ButtonColumns, those are easy. The problem is with the creation of a TemplateColumn via code. I have found examples out there ...

Prevent hiding of ModalPopupExtender when ok or cancel is clicked

I am using a asp.net ModalPopupExtender on a page, and would like to prevent the dialog from hiding when the user presses the ok button in certain conditions. But I can't seem to find a way. What I am looking for is something like this ajax:ModalPopupExtender ... OnOkScript="return confirm('You sure?')" ... if confirm is false, then ...

.NET (web) How to execute some code after all events are handled?

Hi, I have this .NET web app that draws a table in Page_Load. Then after that it handles the events, which should change the table drawn in Page_Load. This is very inefficient. Is there a way to execute the code (which draws the table) after it finishes handling all events? (instead of doing it in Page_Load) Thank you in advance. ...

ASP.NET: Problem with event handlers for dynamically created controls

Hi, I've got this problem with dynamically created TextBox. When the TextBox is created in PageLoad, it's TextChanged event was fired. But when I dynamically delete and recreated the TextBox, the TextChanged was not fired. This is the code: .aspx <asp:Table ID="Table1" runat="server"> <asp:TableRow> <asp:TableCell ...

request.params item disapearing after postback

I have an asp.net application that has a request item which is disapearing after several postbacks. The postbacks are just for validation and ajax calls. The session is not resetting as I still have ~60 items in the params collection ...

Compile errors after converting to a Web Application Project from a Web Site

I'm trying to convert a Web Site to the Web Application project model and I'm running into compile errors that do not seem to be covered by the guidance I found at Converting a Web Site Project to a Web Application Project. The issue is that standard ASP.NET controls that are embedded as child controls within the ContentTemplate of the ...

Upload Image to Database From DetailsView Insert Mode

I am attempting to upload an image to a database via a DetailsView containing an UploadFile control in the Edit Item template. I have a stored procedure which handles the upload to a SQLServer DB which expects two parameters: AuthorName, varchar(20) and AuthorImage, varbin(20). The DetailsView is associated with a SQLDataSource: Author...

Google search code in ASP.NET Master Page

I'm trying to put the following Google generated search box code into a Master page on a site: <form action="http://www.google.com/cse" id="cse-search-box"> <div> <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxx:u3qsil-l6ut" /> <input type="hidden" name="ie" value="ISO-8859-1" /> <input type="text" name="q" siz...

IIS, Asp.NET pipeline and concurrency

I'm wondering how the concurrency in a web application actually works. Ive read several articles and to my understanding multiple instances of HttpApplication would be working at the same time. Now, I created a simple web app to test concurrency and put the following to global.asax: protected void Application_BeginRequest(object sender,...

ASP.NET Passing properties to dynamically generated user controls

I am struggling on something that, I am sure, should be easy. I have been living in backend and winforms code for a long time, and I'm am building my first ASP.NET page in over a year, so apologies for any noobishness I am inside a User Control on a page. On this User Control (Parent Control) I need to embed 0 .. n child user controls ...

ASP.NET Web Services (plural) or Web Service with multiple classes.

Hi All, I am struggling to make a decision regarding the correct organisation for a web service. Should I have multiple ASMX's representing the different functionality in the web service, or should I have a single ASMX? If I have multiple ASMX's, does this not constitute multiple web services? If I have a single ASMX, how do I organis...

Path from where an ASP.NET application is run

An ASP.NET application sends letters in HTML format with links to external images. These images are placed in the same folder where the application is deployed. So before sending it modifies a letter template in such way what the links are correct. Now I use new UriBuilder(Request.Url.Scheme, Request.Url.Host, Request.Url.Port, Re...

Create Outlook Task Request from ASP.NET

I'm looking for a way to create Outlook Task Request from ASP.NET. I'm using Exchange Server 2003 for email server. Basically, user of my ASP.NET application will do something that will create Outlook Task based on some logic. Is this natively supported in .NET or must I use third party component? ...

Reading the selected value from asp:RadioButtonList using jQuery

I've got code similar to the following... <p><label>Do you have buffet facilities?</label> <asp:RadioButtonList ID="blnBuffetMealFacilities:chk" runat="server"> <asp:ListItem Text="Yes" Value="1"></asp:ListItem> <asp:ListItem Text="No" Value="0"></asp:ListItem> </asp:RadioButtonList></p> <div id="HasBuffet"> <p><label>What...

When and why should I consider asp.net MVC?

I've noticed a lot of talk about asp.net MVC lately, but I haven't come across a clear or compelling description of when, where or why I would want to use it over WebForms. Let's say I wanted to build a small web application that allows a person to advertise some items online. The website will have 4 use cases: Search adverts View l...

.Net 1.1 Web application is picking up web.config from root folder

I have a .Net 1.1 web application sitting in a folder called C:\inetpub\wwwroot\MyTestApp, where 'MyTestApp' is a virtual directory and is configured to be on ASP.Net version 1.1.4322 in IIS 5.1. In the root directory (C:\inetpub\wwwroot) there is a web.config file for a .Net2.0 application, because the root folder contains some web pag...

custom validation to compare the float value of two text box

Hi, I am using a custom validator to compare value in two text box. This is comparing the values fine. But it says "025" and "25" are different.. can this do a float comparision. the custom validator i am using is <asp:CompareValidator id="compval" runat="server" ControlToValidate="txtBox1" ErrorMessage="There values are not...

UpdatePanelAnimationExtender always firing

Is there any way to prevent an UpdatePanelAnimationExtender from executing when the associated updatepanel is not updating (i.e. is set to conditional updates)? ...