asp.net

How to disable IIS credentials in ASP.NET

Is there a way to disable IIS default authentication in global.asax or somewhere else depending on passed parameters. A client requests the same form would be secured using IIS authentication and by providing authentication information in POST variables ...

Using FindControl on Dynamically Generated Controls

I have some ASP.NET code that dynamically generates rows and cells for a Table control on the page. I have specifically set the ID of each cell, but I am having trouble getting FindControl to actually find them. Here's the code that I use to create the cells: tbc = New TableCell tbr.Cells.Add(tbc) tbc.ID = String.Format("tc_{0}-{1}-...

Show Download option in C#

I need to download an Access file(Inbox.mdb) file when clicked on asp.net button...? How do i do this is C# / ASP.NET . Any help would be appreciated. ...

Setting Default URL in Web.Config for website

When users navigate to my site, I want it to display : http://example.com and not: http://example.com/default.aspx How can I do that? ...

Replace item in querystring

Hello I have a URL that also might have a query string part, the query string might be empty or have multiple items. I want to replace one of the items in the query string or add it if the item doesn't already exists. I have an URI object with the complete URL. My first idea was to use regex and some string magic, that should do it. ...

ASP.NET FileUpload control not working inside Wizard control.

I have a Wizard control with one of the pages containing a FileUpload control. I want to access the file stream at the point of the final page of the wizard but this doesn't seem to work. As far as I can see, you can only access the file stream for the posted file on the postback which occurs immediately after the control has been used....

Can't see next page in gridview

hi. when I use " AllowPaging="True" " property in gridview and upload my webSite ,when I click next page , I can't see that and I see same record that I see already . point : I bind a dataBase on gridview,and I see that in gridview.above problem when I uplaod my website,happen . what is problem that I can't see next page of gridview ? ...

Create a custom block in web.config for web.config with a random number of elements

I need to create a custom block in web config as follows: <MySettings> <add name="name1" value="value1" /> <add name="name2" value="value2" /> <add name="name3" value="value3" /> ... </MySettings> Ad i understand, i should derive my custom settings class from ConfigurationSection, but i don't know how to make it s...

Error in Gridview application

When trying to use the paging part of GridView in my application, I receive the following error: The GridView 'GridView1' fired event PageIndexChanging which wasn't handled. ...

Finding previous page Url

Hi everyone i am trying to find the url of previous page.Such as if a user navigates from Page A to Page B using Server.Redirect("B.aspx"), page B can display the url referring to it. I have tried using Response.Write(Page.PreviousPage.ToString()); Response.Write(Request.UrlReferrer.ToString()); Response.Write(Context.Request.UrlRe...

Substitution or replacement regular expressions

In an XML file, I am capturing a long list of URLS from a web page, using regex (in .NET). Within the captured URLS, I simply need to substitute '&' for all '&amp;' that are located within the URLS. How do I do this? ...

Form submission on web - image containing characters for user to type in

Often when you fill in a form on the web you are asked to type in some characters from an image to validate you aren't a robot etc. Does anyone know A) what you actually call these things? B) are there any third party tools that can be used to generate the images? (.NET focus here) ...

jQuery UI Dialog + ASP.NET textboxes + focus

Problem I am using jQuery UI dialog to show a dialog box with some ASP.NET textboxes and a button in it. However as jQuery moves the div for the dialog box outside the form I need to re-move it back to the form myself (see this for details why), so that ASP.NET still works. This moving is causing a problem, where the field does not get ...

Is it possible to Validate ASP.NET pages as valid HTML before compile

Following my question here I run the suggested Tidy Program which came back with a whole load of errors regarding the tool not recognising ASP tags. Is it possible for a tool to validate ASP.NET pages before compile/delivery via a browser? ...

CSV + Dropdownlist column association

Hullo to all! This question is more about a shortcut than anything: Is there a simple, yet efficient way to associate column names to csv data? Problem: I need to associate column names (and bind them) to import the csv file correctly to my SQL Server database. I don't know before I see the csv what column of the csv will contain what...

Splitting CamelCase

This is all asp.net c#. I have an enum public enum ControlSelectionType { NotApplicable = 1, SingleSelectRadioButtons = 2, SingleSelectDropDownList = 3, MultiSelectCheckBox = 4, MultiSelectListBox = 5 } The numerical value of this is stored in my database. I display this value in a datagrid. <asp:boundcolumn dat...

DataTable.Select("Bla='Blablabla'").Count Returns 'Count' is not a member of 'System.Array' Exception

I'm trying to access the Count Property on the array of rows returned by the datatables select method, this is after converting the Web Project to 3.5 ...

Putting an object in session via a property in ASP.NET

This seems like it might be a bad idea, but I can't figure out why: I have a class, cXYZ, with properties A, B and C. It also has a method 'sGetData' that loads those three properties from the database, and a method 'sSaveData' which saves it back. class cXYZ public property A as string... public property B as string... public ...

Hiding the stacktrace for an exception returned by a asp.net WebMethod?

I am using methods with the Attribute [WebMethod] in my aspx pages. I don't use any asp.net ajax but jQuery to call these methods and return objects in JSON. This all works fine. Next I added an authorization check inside the webMethod, if the current user doesn't have access to the feature I need to let the calling JavaScript know. So...

How can controls (buttons) be set in a ModalPopup Extender panel that do NOT close the panel?

Here's the situation. When a user is editing a given piece of data, they're allowed to add messages/comments. These are stored as child records in a SQL database. Clicking on the Add Message button brings up a panel (pnlMessage) courtesy of the AJAX ModalPopup Extender. This takes some input and, when the "Send Message" button in the pa...