asp.net

Convert Web Form to Web Content Form after the fact. (.net)

I have a site a few years old that contains about 30 aspx Web Form pages with code behind. I want to add a common master page to all these with the minimum amount of work. Essentially, I just need to add everything in the body tags to the Content Placeholder, and preserve the code behind. Is there a fast way to do this? ...

Enter button does not submit form (IE ONLY) ASP.NET

I have a form with a textbox and a button. IE is the only browser that will not submit the form when Enter is pressed (works in FF, Opera, Safari, Chrome, etc.). I found this javascript function to try to coax IE into behaving; but no avail: function checkEnter(e){ var characterCode if (e && e.which) { e = e cha...

SQL - querying via a textbox which could take different values

Developing a website and just trying to get back into the swing of (clever) SQL queries etc, my mind had totally gone tonight! There is a website http://www.ufindus.com/ which has a textbox allowing you to enter either a place name or a postcode/zipcode. I am trying to do something similiar but I am rubbish at SQL - so how do you const...

Is it better to have one UpdatePanel around multiple controls or separate UpdatePanels?

Hello, I have a web form that has multiple ListBoxes, TextBoxes, DropDowns. If I put one UpdatePanel around the whole page, I noticed the page is slower. Is this because, every control is being updated? If I put different UpdatePanels around each control, I noticed the page has a better response. Is it right to assume that this is b...

ASP.NET - Storing SQL Queries in Global Resource File?

Is it a good idea to store my SQL queries in a global resource file instead of having it in my codebehind? I know stored procedures would be a better solution but I don't have that luxury on this project. I don't want queries all over my pages and thought a central repository would be a better idea. ...

3rd Party Password Management with Complete Integration

I use C#, IIS, ASP.NET, SQL Server. Is there a third-party platform I can easily integrate into my system, to handle password management? It would have to integrate 100% (no OpenID), so that the users would not notice. ...

barebone asp.net

Is it possible to do Web form without using server control or set runat attribute on html control? How do you call the code behind function? ...

Print PDF from ASP.Net without preview

Hi, I've generated a pdf using iTextSharp and I can preview it very well in ASP.Net but I need to send it directly to printer without a preview. I want the user to click the print button and automatically the document prints. I know that a page can be sent directly to printer using the javascript window.print() but I don't know how to m...

How would I go about figuring out the maximum load my server(s) can handle?

In Joel's article for Inc. entitled How Hard Could It Be?: The Unproven Path, he wrote: ...it turns out that Jeff and his programmers were so good that they built a site that could serve 80,000 visitors a day (roughly 755,000 page views) How would I go about figuring out the maximum load my server(s) can handle? ...

PageRequestManager is undefined

I am seeing this error intermittently. My app throws PageRequestManager is undefined and so fails to load. Oddly enough this only happens in firefox, ie loads fine. Anyone know what this error means. I've been working on the app for some time and I just started seeing this today. ...

How can I determine what WebMethod was called in a webservice

The situation is this. I have an asp.net webservice application...say a page called api.asmx In the code behind I have several methods, for example: [WebMethod(Description="Method1")] public int GetSomething(int num1, int num2){ try{ return SomeObject.DatabaseCall.DoSomething(num1, num2); } catch(Exception ex){ object[] ...

listbox validation

how do i check if an item is selected or not in my listbox? so i have a button remove, but i only want that button to execute if an item is selected in the list box. im using asp.net code behind C#. I'd prefer if this validation occurred on the server side. cheers.. ...

Ideas for how to deal with viewstate when using ASP.NET AJAX and update panels

Here is a class that I wrote to solve some issues that I was having with viewstate. It stores the info in the users session and increments a value to track which state to show. The difficulty is that there is no support for the back button. The reason I originally had this was that before AJAX came along the viewstate was being send d...

export Datagrid to excel asp

whats the best way to export a Datagrid to excel? I have no experience whatsoever in exporting datagrid to excel, so i want to know how you guys export datagrid to excel. i read that there are a lot of ways, but i am thinking to just make a simple export excel to datagrid function.i am using asp.net C# cheers.. ...

Lucene.NET --> access denied to segments

Hey all, I have a problem with Lucene.NET. During an index, I receive the error 'Access to the path segments is denied'. Or sometimes 'Access to the path deletable is denied'. I eventually gave 'Everyone' full security rights to the index directory, but the problem still existed. I then found out that during the index run, lucene renam...

Loading a value on the insert command of a detailsview

Hi, In a detailsview, how can I prepopulate one of the textboxes on the insertcommand (When the user clicks insert and the view is insert). I think this would work for codebehind: Dim txtBox As TextBox = FormView1.FindControl("txtbox") txtbox.Text = "Whatever I want" Is this right? What do I need in the aspx (not as sure)? Also, I'm...

How to consume data from an ASP.NET MVC from a different website?

I am playing around with ASP.NET MVC for the first time, so I apologize in advance if this sounds academic. I have created a simple content management system using ASP.NET MVC. The url to retrieve a list of content, in this case, announcements, looks like: http://www.mydomain.com/announcements/list/10 This will return the top ten ...

Am I supposed to be able to alter other controls from an ASP.NET page event handler?

Hi, I'm trying to disable a label control from the CheckedChanged event handler of a checkbox. Should I be able to do this? At the moment if I set Enabled to false nothing changes when the page reloads. If I do the same thing in Page_Load then I see the change. To clarify: This doesn't work: protected void chkNeverExpires_CheckedChan...

Asp.Net MVC: Server Controls vs Html class to render controls?

What are the advantages of rendering a control like this: <% Html.RenderPartial("MyControl") %> or <%=Html.TextBox("txtName", Model.Name) %> over the web Forms style: <uc1:MyControl ID=MyControl runat=server /> I understand that performance can be one reason because no object needs to be created but having the possibility of callin...

Storing temporary user files in ASP.NET in medium trust

I have a scenario where users of my ASP.NET web application submit testimonials consisting of text info and images. The submit process has the following steps: First the user inputs the content and chooses a path to an image When he clicks preview, the info is once again shown so that he can confirm Once confirmed the info is persisted...