asp.net

Don't Change URL in Browser When Clicking <asp:LinkButton>

I have an ASP.NET page that uses a menu based on asp:LinkButton control in a Master page. When a user selects a menu item, an onclick handler calls a method in my C# code. The method it calls just does a Server.Transfer() to a new page. From what I have read, this is not supposed to change the URL displayed in the browser. The proble...

When is it ok to disable event validation on a page?

I am using ASP.NET ajax to dynamically add/remove controls from a page without using full postbacks. The UI is very complicated. Under certain scenarios, when a control on the page causes a full postback, after changing the controls via async postbacks, I get this error: http://stackoverflow.com/questions/228969/aspnet-invalid-postbac...

How do I get jQuery to select elements with a . (period) in their ID?

Given the following classes and controller action method: public School { public Int32 ID { get; set; } publig String Name { get; set; } public Address Address { get; set; } } public class Address { public string Street1 { get; set; } public string City { get; set; } public String ZipCode { get; set; } public String State...

ASP.NET ViewState postback with page refresh and bookmarks

The ASP.NET ViewState feature can sometimes be a double edged sword. I rely on it on most of my projects and it speeds up development considerably. My problem is that sometimes users will try to refresh a page which will cause the viewstate to be lost, other times the user might want to bookmark a page but when the get back the viewstat...

Easiest way to display XML on an ASP.NET page

I have some XML in an XmlDocument, and I want to display it on an ASP.NET page. (The XML should be in a control; the page will have other content.) Right now, we're using the Xml control for that. Trouble is, the XML displays with no indentation. Ugly. It appears that I'm supposed to create an XSLT for it, but that seems kind of bor...

Problem implementing Paul Johnson's Web Widget code, it works in VS 2008 but not in deployment to IIS 6.0

Using the instructions from Paul Johnson's Web Widgets page I created my own custom widget. However because I was deploying to IIS 6.0 I utilized the web.config change recommended to render the page since the IIS 7.0 configuration management option was not available in IIS 6.0. The widget renders correctly when debugging with VS 2008. ...

How to set selected row in ASP.NET GridView based on DataKey?

I want something similar to the following pseudocode: myGridView.SelectedIndex = myGridView.DataKeys.IndexOf("mySpecificKey"); I've done some Intellisense exploring, but I haven't found an obvious way to do this. I would want to set SelectedIndex to -1 if DataKey was not found. ...

SQL Server Template-Driven Data Entry Question

Based on the answers to this question about dynamically accessing tables, I've decided to take a couple steps back and get some advice on the larger picture. I am revisiting the database design of a Windows Forms application which I am rewriting for the Web using ASP.NET. Also, I have ported our database to Sql Server, so it can handle...

What is a good setup for handling session / "flash" style messaging in ASP.NET

I am building ASP.NET 2.0 websites and currently I some home grown assemblies for a DAL, some business objects and other assorted shared stuff. I've put together a basic set of objects to handle messages to the UI (i.e. errors and other status messaging). It consists of: StatusMessage which has a text property and a color property t...

Accessing Active Directory in ASP.NET?

I use a console application to write some test code: /// <summary> /// Returns AD information for a specified userID. /// </summary> /// <param name="ntID"></param> /// <returns></returns> public ADUser GetUser(string ntID) { DirectorySearcher search = new DirectorySearcher(); ...

How do i save a web form into a MySQL database?

I have an ASP.Net form and i would like to save it into a database any ideas?? ...

How do I associate the Enter key with a button on an aspx page?

I have an asp.net ascx control file and I have put the control on an aspx page. The aspx page has a button in which when I press enter on the keyboard, I want it to fire the event handler for the button. Is there a way to set this? I am using a master page with a button already on it, so now when I press the enter key, the event handl...

Displaying International Text

I am looking to create an ASP.net page that will have a control like GridView or Repeater and the data to be displayed in this page can be either unicode or Utf-8 . I am really struggling to display languages like Hebrew and some asian languages. How do I show any type of language on the ASP.net page?? I have tried the meta tag option ...

Set the file path and name properties before uploading

If you know the local path and file name of the file you want the end user to upload (via browser). Then is it possible to pre-set these properties for the HTML file input element (or any upload control)? So when the user clicks 'browse' to select the file to upload, then the dialog has preselected the filename. Btw, assume that this is...

How would you architect visitor and admin functions in a single ASP.Net MVC web application?

So I have been working on a small web application (site) for a group of friends of mine and have come to the realization that things need to change. The application has two faces to it a public facing side that serves dynamic data to visitors and non admins, and an admin side where admins can update or create the dynamic data to be ...

How to minimize a ASP.NET C# project DLL size?

I´m working on a project, in Visual Studio 2008, which DLL currently surpasses 20 MB. Is there a way to profile that DLL, searching the main contributors to this size? I suspect that breaking it in smaller projects inside the solution would help, but I'm looking for a faster solution (although not better, I'm afraid). As a sidenote, w...

Why is this code stopping? VB ASP.NET

Hey I am coding using Visual Studio 2003. My program worked fine until I introduced a dll I made using CreateObject. Code: Set docs2 = server.CreateObject("DocGetter.Form1") docs2.GetDocument oXMLDom,numID It appears to be getting stuck at this code. I've already used regasm to register the dll. What else could be wrong? ...

asmx wsdl loading forever

I have a web service application which has suddenly stopped working. I have enabled directory browsing in IIS, and can view the application directory. I can view the xml files within the application directory, but I cannot view the .config files, nor can I view the wsdls of any of the web services. When I try to browse to http://serve...

How to migrate from sql server express to sql server?

I have been developing a web app that I wish to deploy on godaddy that is using a .mdf file for data. I would like to use a sql server database that comes with the account for my data. What is involved in setting up my config and how do I get the schema copied over? Here is the error I get: The 'System.Web.Security.SqlMembershipProvide...

How do you get access to the current System.Web.Routing.RequestContext from within a custom helper method in ASP.NET MVC?

I'm writing a helper method for ASP.NET MVC and I need to call Url.Content to get an appropriate URL for the context. However, in order to create a new UrlHelper() I need to get the current RequestContext (System.Web.Routing.RequestContext to be precise) and I'm not sure how to grab it. Anyone know? ...