webforms

asp.net ensure javascript is loaded once only

I've been working in asp.net webforms and I've been making a UserControl that depends on a small bit of javascript which is in an external file. I want to be able to put a reference to the javascript inside the UserControl to ensure that it gets loaded on the page, but the problem is that the UserControl can appear multiple times on a ...

What is wrong with this file path?

Hai guys, I have two folders called CSVLoad and Forms... I have an aspx page inside forms folder which has a fileupload control. I save my uploaded file to my CSVLoad folder i gave the following path FileUpload1.SaveAs(Server.MapPath("CSVLoad//" + FileUpload1.FileName)); I am receiving file not found exception... Could not find a p...

ListView fields not getting posted

I know I've done something like this before, but I have no idea why it isn't working now. I have a ListView with some textboxes. I want to read the text out of those boxes when I click a button (linkbutton, whatever). <asp:ListView runat="server" ID="lv_bar" EnableViewState="true"> <LayoutTemplate> ...

Getting some weird results when nesting Login control inside absolutely positioned element

Hi Login control is nested inside the div element. aspx file: <div id=”parentE”> <asp:Login ID="Login1" Width="100%" runat="server"> </asp:Login></div> CSS file: #parentE { position: absolute; top: 16px; right: 300px; width: 60px; ...

Basic validation for every field

It seems to me that any method of input I provide for a user needs some scrutiny, but I have never seen someone implement a single set of validation that all inputs must pass. Is there some basic validation you do on every single field a user can type in to? For the sake of simplicity let's just talk about text boxes. Do you add any co...

Asp.net datalist RepeatDirection.Vertical shows horizontal? set repeatcolumns in code behind

hello everyone. i have a datalist in my aspx like this: <asp:DataList ID="dlSubs" runat="server" CellPadding="0" CellSpacing="5" RepeatDirection="Vertical">...</asp:Datalist> when i do this in the code-behind: this.dlSubs.DataSource = dtCat; // dtCat is a datatable with about 13 rows this.dlSu...

Table grid control for ASP.NET

What is the best way for me to build a control that will kinda work like an Access table in ASP.NET? That is, I define, say, 3 columns. The user can add/edit/remove rows. It can be one row at a time, that's fine. There are other fields on the form too, not related to this table. When the user is done adding rows of information, then...

RadioButtonList without the Radio Button Circle?

basically, i just want the RadioButtonList without the radio button on it, i will code the rbl so that selected items have a different background color and make it look more professional, the radio buttons themselves i want to be able to get rid of in terms of apperance... if you know of any way to do it, please do let me know! ...

What is the best way to use a radio button in an iPhone web app?

I'm creating a web application that is optimized for the iPhone (but also should work on all mobile devices). I have a form field that includes one standard text input and then need a radio button group with two options (Inbound/Outbound). The radio button makes the most sense logically since one option should be selected by default and ...

Web infastructure for learning purposes?

I come from a traditional programming background by which I mean C, Java, C#, C++ and a little python and VBA. Now I'm trying to create a small CRUD application for the purpose of taking a form and turning it into an online form and database for later querying. My initial thinking seems to lead me to Ruby on Rails given the fact that...

Having troubles setting the appearance of a web control

hi I'm trying to set the appearance of a Login web control, but I'm having quite a few problems. As far as I can tell, I've set everything correctly, but for some reason control still isn't displayed correctly: a) The width of the two TextBox controls ( with IDs UserName and Password ) should be equal to 70% of table's width, but it...

Can we declaratively set the Style property of a web control?

I’ve noticed that on aspx page IntelliSense doesn’t display the Style property of a web control, even thought the control does have a Style property. Does that mean we shouldn’t declaratively set the Style property: <asp:TextBox ID="UserName" Style="color:Green; padding:0px; margin:0px;" runat="server"></asp:TextBox> ...

How to use System.Web.Routing to not URL rewrite in Web Forms?

I am using System.Web.Routing with ASP.NET (3.5) Web Forms that will URL rewrite the following URL from http://www.myurl.com/campaign/abc to http://www.myurl.com/default.aspx?campaign=abc The code is as below: public static void RegisterRoutes(RouteCollection routes) { routes.Add("CampaignRoute", new Route ...

Useful/Realistic code coverage goals for a brownfield ASP.NET application

Let me qualify this question. I'm working on a "classic" ASP.NET application (Web Forms) that doesn't use Model-View-Presenter and was not written using TDD. It's also using an antiquated data access strategy (hand written DAO layer that invokes stored procs to populate and persist objects) that is unlikely to be upgraded to an ORM desp...

Help me choose a data entry system for multiple users at multiple sites

I've just started working on a project that will involve multiple people entering data from multiple geographic locations. I've been asked to prepare forms in Access 2003 to facilitate this data entry. Right now, copies of the DB (with my tables and forms) will be distributed to each of the sites, returned to me, and then I get to hamm...

How to implement a modifiable table on a web page?

I would like to create an HTML page that contains a table, where one column is editable by any user (after logging in). (As a bonus, the table should be sortable on any column.) It's sort of like a wiki page, except the users are not supposed to edit wiki source code, but simply modify values in the modifiable column of the table. Are ...

How to update design-time UserControl interface based on property value?

I've created a UserControl with the following public property: [Browsable(true)] public string Text { get { return pnlLookupTable.GroupingText; } set { pnlLookupTable.GroupingText = value; } } pnlLookupTable is, as you may have guessed, a Panel control. I can change the value of the Text property in the Properties window and ...

Google Apps Account Form won't pre-populate URL query string in iframe

I can not get pre-population to work on an embedded form... If I use the regular url... it works... https://spreadsheets.google.com/a/DOMAIN.org/viewform?hl=en&amp;formkey=12345&amp;entry_3=John&amp;entry_4=Doe but for a google apps account on an embedded form - does not work Loading... Form appears in the webpage, but the additiona...

How can I get the button that caused the submit from the form submit event?

I'm trying to find the value of the submit button that triggered the form to submit $("form").submit(function() { }); I could possibly fire a $("input[type=submit]").click() event for each button and set some variable, but that seems less elegant than some how pulling the button off of the the form on submit. ...

Is there a way to suppress Visual Studio URI validation warnings in ASP.NET WebForms?

I'm trying to prevent Visual Studio from trying to validate my relative image URIs for a WebForms project, but I can't find a way to do it. So far, I can't find any kind of warning ID or category. The images can't be resolved because they are not 'included' in my project, even though they do exist in the file structure. This is a large ...