asp.net

Method to Find GridView Column Index by Name

I am trying to write a small method to loop through and find a GridView Column by its Index, since it can change position based on what might be visible. I'm not sure if I'm taking the right approach and I can't quite get it working. Can anyone lend a hand? Here is what I have so far: private int GetColumnIndexByName(GridView grid, st...

Setting dropdown to first value

I have an .aspx hidden control that stores a defaultId for this dropdown. However, the values in the dropdown can change and sometime the defaultId is listed as one of the selections, other times it isn't. When the drop down clears we run this to reset it: Global.getComponent("ddlVehicleType").setValue(Global.getComponent("DefaultVehicl...

What is a simple way to secure a directory in asp.net?

Is there an easy way to do this? ...

how the exclude a asp.net web control from the tabbing order

I've been trying to exclude an asp.net web control from the tabbing order. The control that i'm using is the RadioButtonList control. I've try setting the TabIndex to either 0 or -1. The problem that i'm running into is ... initially the control is skipped (which is good), but it seemed like the engine just shifted the control to the end...

Display current webpage size

Is there an easy way to show the size of an aspx webpage in bytes (i.e length not screen size) - to save clicking File..Properties in the browser. Possibly some javascript method, or a way of getting it from the Response object perhaps? ...

Finding out is user fully completed download or not

I have an webapp which dynamically generates a file and stores it on the server. When a user comes along, this file is served, after which it gets deleted. Each user gets their own generated file after which it becomes useless. Is there a way to know if the user managed to download the file fully, so that it may be deleted and not clo...

Does ASP.Net have a future?

With all browser compatible JS libraries (like JQuery, MooTools), asynchronous data transfer and web services, does asp.net has any future? A very good web application can be designed with loads of web services and JS library based UI. Why one should use heavy ASP.Net? I don't see ASP.Net having any place in future enterprise software de...

Find out a CHECKBOX in a DATAGRID in ASP.NET

hi, I have a GRIDVIEW and with several CHECKBOXS. When i selected a CHECKBOX I need run some code. To detect it, I use an EVENT HANDLER for the CHECKBOX included in a GRIDVIEW. I cannot access the CHECKBOX with my wrong code. Do you have any idea what I am doing wrong? Thanks for your help. Bye ASPX <asp:Label ID="uxMessageDisp...

How to set the file types in the coolite FileUploadField

I using coolite in my project. And upload files through the FileUploadField control. I have to add a filter for the file type, so that the user could see only jpeg and bmp files from the choose file dialog. Havent found how this can be implemented in the web. Can anyone give me a hint on this one? ...

supersize calendarextender

How can I resize the ajax control toolkit's calendarextender so it's touch friendly, I have modified the css properties successfully but when selecting months or years, the months (or years) overlap the days, and don't collapse after making a selection. Here is the css I'm using so far: .ajax__calendar_container {padding:4px;position:a...

Styling the relevant input on validation error, like MVC

I have search the net and not found anything that has helped, so thought I would ask on here. I have a simple asp.net 2.0 form. <form runat="server"> <asp:ValidationSummary ID="ValidationSummary1" runat="server" /> <asp:TextBox ID="txt1" runat="server" ValidationGroup="valGroup1"></asp:TextBox> <asp:RequiredFieldValidator ...

ASP.NET upgrade seems to be taking a very long time to start

At work I'm tryhing to upgrade an ASP.NET 2.0 app (which we wrote using VB.NET 2005) to ASP.NET 4.0. I had a few problems during the upgrade, but eventually worked them all out. At the end of the day I decided to give it a quick compile and see if I'd get the start page, so I hit F5 in VS 2010. I left it that way, and man was it actin...

ASP.Net debug directory monitoring exception

When I start my ASP.Net 4.0 web app in debug mode, I'm getting the following exception: System.Web.HttpException occurred Message=Invalid file name for file monitoring: 'C:\src\main-232\src\ZNode\Znode_MultiFront\Web\Controls\Cat5\Navigation'. Common reasons for failure include: - The filename is not a valid Win32 file name. - The fil...

Coalesce operator in C#?

I think i remember seeing something similar to the ?: ternary operator in C# that only had two parts to it and would return the variable value if it wasn't null and a default value if it was. Something like this: tb_MyTextBox.Text = o.Member ??SOME OPERATOR HERE?? "default"; Basically the equivalent of this: tb_MyTextBox.Text = o.Me...

asp.net/sql get everything in the string before the "-" and put it into a different string

Basically I have got two things i am passing from a command argument <asp:LinkButton ID="lbEditDetails" Text="Edit..." runat="server" CommandName="EditDetails" CssClass="EditAdults" CommandArgument=<%# DataBinder.Eval(Container.DataItem, "number_slept") & "-" & DataBinder.Eval(Container.DataItem, "booking_ref") %>></asp:LinkButton> I...

Cannot start WCF Service - "The service cannot run your command at this time"

Hi - I've been having issues getting a service to start. I have 2 other services are identical in configuration in just about every way that start fine, but one of them refuses to start and I really need to get it to work today. I can't see any difference in their implementation or config files. I'm receiving the following messages wh...

Passing an array of values in an ASP.NET jQuery AJAX POST

I have a ListBox on my page, and I'd like to make an AJAX post containing all the selected items. Here's my code: $('#btnSubmit').click(function() { $.ajax({ type: "POST", url: 'Default.aspx/GetSelectedValues', data: '{selectedValues: }', contentType: "application/json; charset=utf-8", dataTyp...

iterate all properties in the list

I have List (Of Report). Report has 90 properties. I dont want write them each and every propertiy to get values for properties. Is there any waht to get propeties values from the List Ex: Dim mReports as new List(Of Reports) mReport = GetReports() For each mReport as Report In mReports 'Here I want get all properties values witho...

ASP.NET Is there a way to add two "OnItemCommand" to my asp:repeater

I have two button with different commands <asp:LinkButton ID="lbEditDetails" Text="Edit..." runat="server" CommandName="EditDetails" CssClass="EditAdults" CommandArgument=<%# DataBinder.Eval(Container.DataItem, "number_slept") & "-" & DataBinder.Eval(Container.DataItem, "booking_ref") %>></asp:LinkButton> <asp:LinkButton ID="lbSubmitD...

ajax javascript error, break point points to the view state?

I have an aspx page that is getting an Object Expected javascript error on submit, but when you break into the error the breakpoint is somewhere in the middle of the __VIEWSTATE input html element. A javascript stack dump shows just "{anonymous}(null)". What does this mean and how does one go about debugging further? ...