asp.net

Telerik RADGrid - most efficient use

Do you typically use the designer or do everything in the ASPX? Are the resources you've found particularly helpful to come up to speed quickly on how to use this control? I've noticed the intellisense comments for this control are minimal. I'm continuing to browse the documentation on Telerik's web site, I'm wondering if there are an...

How to add Item to SqlDataSource databound list

I am lazy - and I am using a SQLDataSource to populate my dropdownLists. The Databind event for the databound objects is called before the Page.PreRender so I am doing something like this in the PreRender eventHandler: private void InitializeDropDown() { this.myDropDown.Items.Insert(0, new ListItem("-- Select someth...

Multiple user control instances and ClientID in JS

I am using <%= ClientID %> in the javascript to get the ID of a dynamically loaded user control. Everything works fine until multiple instances of the same control are loaded. The ID points to the ClientID of the user control that was added last. How do I solve this issue? EDIT: I am doing a: var clID = <%= ClientID %> in javascript...

ASP.NET page events - Button click event comes after GridView bind

My understanding of the order of page events is this: Page : Load Control : DataBind (for a GridView or whatever) Control : Load Control : Clicked (for a Button) Page: PreRender Control : PreRender (There are lots of others - but these are the ones I'm interested in) The important thing to notice here is t...

Will enabling a page-level trace in ASP.Net page recycle my application pool?

If I add "trace=true" into my directive on an asp.net 2.0 .aspx page, will it recycle my application pool? I know if I enable tracing in web.config that will recycle the application pool. The webserver is IIS 6.0. Thanks. ...

Any suggestions for making Silverlight content available to search engines?

Assuming the following: You have some content currently being displayed in an ASP.NET HTML table. You want to use Silverlight for a better user experience. It is important that the information be indexed in Google, et al. What do you do? I know that XAP (Silverlight executables) contain XAML which could theoretically be indexed. But ...

How to implement GZip compression in ASP.NET ?

Hi, I am trying to implement GZip compression for my asp.net page (including my CSS and JS files). I tried the following code, but it only compresses my .aspx page (found it from YSlow) HttpContext context = HttpContext.Current; context.Response.Filter = new GZipStream(context.Response.Filter, CompressionMode.Compress); HttpContext.Cur...

Close window response stream excutes Javascript. Why?

I have the same problem description here. I solved this problem by adding the following Javascript code to the aspx page: window.opener = null; window.open ('','_self'); window.close(); The new page opens and pops up a filedownload dialog and the page closes. But I don't understand why the Javascript code executes. The response typ...

Style Sheet is not working in one web page

Style sheet in master page is not working for one web page of asp.net application but it works for another web page. ...

Need to generate a image in ASP.Net through webservice

For my new asp.net application that I am developing I would like to generate an image at runtime using a webservice (return bytes), and show this as a image using Javascript (so that I can have ajax functionality. Any ideas how to do this? Or any ideas as to how I can generate an image at runtime, and show it on my webpage using Ajax (...

Is it possible, to work with ASP.NET 2.0 or ASP.NET 3.5 under Apache 2.x?

I know, that there is a solution in the following blog: http://weblogs.asp.net/israelio/archive/2005/09/11/424852.aspx Has anybody tried to get it work under production circumstances? Greetings, Andre ...

Logging errors/exceptions with log4net

Hi all, I'm trying to log all exceptions to a sql server database through log4net, and I've seen some posts here explaining how to properly configure the web.config file, but my question is: do it is enough to get the exception logged (the application will log automatically, but in this case it does not work on my app), or do I have to...

How to gain control over the construction of a WebService

Hi, I'd like to gain control over the construction of a WebService instance in ASP.NET. This is what I did so far: I created a .ASMX file and pointed it to a Class with WebServiceBinding and WebMethod attributes attached to it as usual. At the time I browse to the .ASMX file ASP.NET will automatically create an instance of the Class fo...

ASP.NET Multiple controls with the same ID 'x' were found. FindControl

Hey Guys, Getting the following error Multiple controls with the same ID 'ltlItemCode' were found. FindControl requires that controls have unique IDs. This Error does not happen on page loads but when I change the value of a drop down which has AutoPostBack="true". Code is `//Number of Services numberofServices = Int32.Pa...

ASP output surrounded by <form> tags?

Simply, When creating a new aspx page in Visual studio, it automatically adds tags like these: <form id="form1" runat="server"> Are these form tags required to wrap the entire HTML output of the page? e.g.: <body> <form id="form1" runat="server"> HTML GOES HERE </form> </body> Or can they just be placed where you require an actual...

ASP.NET EventHandling

Hi, I create a servercontrol for ASP.Net. For being short and precise I just list the things I do: (1) Call EnsureChildControls in OnInit (2) Create a dynamic table in CreateChildControls: Table aTable = new Table(); aTable.ID = this.ID + "$" + T; TableRow aRow = new TableRow(); aRow.ID = aTable.ID + "$R" + <COUNTER>.ToString(); Tabl...

Adding controls dynamically to an UpdatePanel in ASP.NET AJAX

I have the following really simple code <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:PlaceHolder ID="PlaceHolder1" runat="server"> </asp:PlaceHolder> <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1...

ASP.Net Entity Framework Model

Is it possible to add properties to my model that dont exist in the database? For example I have a calendar table, I want to retireve this data in my MVC controller then work out time left until each entry starts and return this to the view. So I would like another property in my calendar model to hold time left which is a value that I ...

How to Access a Local Resource in a Theme from an ASP.net Page?

I have a resource file placed in the App_LocalResources folder inside the folder for a theme in App_Themes like so: \App_Themes\Theme1\App_LocalResources\Resources1.aspx.resx How can I access the resources in this file from a web form in my project, assuming the web form is called Resources1.aspx having Theme="Theme1"? ...

Visual Studio - Why do .ASPX files take so much longer to load than .ASPX.CS files?

Hi all, This may be a stupid question, but it's something that bugs me on a regular basis, so no harm in asking here I guess. What exactly is Visual Studio doing when I open up an .ASPX file and it takes a good 4-5 seconds longer than if I was just opening the code behind file (.ASPX.CS). I've noticed this happening with VS 2003, 2005...