asp.net

VS2008 targeting ASP.net 2.0: Project-level imports warning

I have a web app built against asp.net 2.0, but keep getting the following warning: Namespace or type specified in the project-level Imports 'System.Xml.Linq' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name d...

What is the best way to stream video via a website built with ASP.NET?

I am looking for everyone's opinion on what is the best way to stream video from a website built with ASP.NET. Some notable items include: The ability to stream .avi, .mpg, and possibly .wmv files The ability for someone to upload a video directly to a shared server and have it stream without any additional work needed (no compression...

ASP.net: Can you call ModalPopupExtender from GridView's edit button?

Can you call ModalPopup from GridView control's Auto generated Edit button? Can someone provide a link on how to do this? ...

Assign an event to a custom control inside a Repeater control

Hello to all, I have a Repeater control which in some of its cells contains a UserControl which contains a DropDownList. On the ItemDataBound event of the Repeater control I'm assigning an event to the DropDownList like so: protected void MyRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e) { ... MyControl myControl = (MyCo...

Determine why Bound Data is not available at PostBack

I've got an ASP.NET GridView that's been extended to provide a "row click" functionality. I data bind anywhere from 1 to 10 records and display it to the user. The bug I'm hitting is that the control will not have any data associated with it on postback. I have observed this behavior only when I click on a row before the rest of the...

Troubleshoot a 'Sys' is undefined message in my upgraded web application

I have a web application that was originally written on .Net 1.1 Framework. I have since tried you upgrade it to .Net 3.5 Framework. I am now getting this javascript error throw on my page and for the life of me can't figure out exactly why. I have target the application for the .Net 3.5 framework, and even deleted and added back in th...

ASP.NET MVC & JQuery Dynamic Form Content

I would like to dynamically add fields to an ASP.NET MVC form with JQuery. Example: <script language="javascript" type="text/javascript"> var widgets; $(document).ready(function() { widgets = 0; AddWidget(); }); function AddWidget() { $('#widgets').append("<li><input type='text' name='widget" +...

How to add checkbox column to a gridview within a MasterPage? (Or, how can I convert a LiteralControl to Checkbox)

Hi, I have a gridview that I have added a checkbox column using a templatefield (I want the user to be able to check/uncheck the box. I want to be able to populate the checkboxes, but when I try to cast the column as a Checkbox on the RowDataBound event, it errors. I also can't do a FindControl due to the Masterpage (I think) Any help...

Are there any real limitations in Mono regarding ASP.NET?

I am a junior developer, doing my last year at college. I'm mostly asp.net oriented and even have a part time job coding in that language. I am interested on converting to linux and since visual studio is unsupported write my code in Mono. Are there any notable limitations in Mono that I should be aware of (regarding ASP.NET)? ...

What's the best solution for file storage for a load-balanced ASP.NET app?

We have an ASP.NET file delivery app (internal users upload, external users download) and I'm wondering what the best approach is for distributing files so we don't have a single point of failure by only storing the app's files on one server. We distribute the app's load across multiple front end web servers, meaning for file storage we...

Alternative to GridView that sorts, pages and is cheap or free?

I've been spoiled by the SqlDataSource, but I'm in a scenario where I can't use it. Is there an alternative to GridView that implements sorting and paging for arbitrary data sources? I'm trying to avoid writing 1000s of lines of custom paging and sorting for each grid. At the office I use Telerik's grid, but for my hobby project, spend...

How to reference a DLL in the web.config?

Hi guys, I have a DLL in the BIN folder, and I need it to be referenced in the web.config, or I get that annoying error: Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Co...

Dropdownlist selecteditem is always the first item despite selection

I have a 4 dropdown boxes. The first 2 will populate the 3rd box. The 3rd box populates the 4th dropdown. When I go to submit, I go get the selectedvalue of the 4th dropdown. For some reason this is always the first value and not the actual selected value. The screen clearly shows another item selected. What may be the problem? Tha...

How can I work around the fact that I can't put a code block in a skin file?

I have a asp.net page I'm writing and I'm perplexed by this problem. I have 3 DetailViews that I bind with LINQ. The binding works great. Now, I have a Skin file that I want to use to layout the DVs, and it looks like this. <asp:DetailsView SkinID="blogViews" runat="server" Width="100%" CssClass="post" AutoGenerateRows="False" GridLine...

How to create an instance of a page

I have an interface IPageState which has a method ClearState. I want to create an instance of an asp.net page which implements this interface and call the ClearState method on that instance. Can anyone help me as to how to create the instance of an asp.net page. ...

Change background color of menu based on menu selection

I have a horizontal css menu with 5 items. e.g 1) Home 2) Users 3) Category 4) Products 5) Contact When "home" is selected the background color (via css) of the entire menu div (id="topmenu") is blue. I want the background color of the div to change to say green when "users" is selected and say purple when "category" is selected. How...

ASP.NET MVC ViewData Null

Hi, I am currently creating an e-commerce site using C# ASP.NET MVC and have just come across a problem. On pages such as product pages and search results pages, I have to pass Lists of data from my controller to the ViewPage and that works just fine. However, a null reference exception occurs if the Viewdata equals null. It happens ins...

How to embed HTML created by Dreamweaver into an ASP.NET applicaton

I've been asked by a friend, who created a very visually appealing website mostly in Dreamweaver, to add some database backed functionality that I really only know how to do in ASP.NET. The problem is when I load his generated HTML into an ASPX page it renders it quite horribly. I've tried adding a basic .html page to an ASP.NET project ...

"HttpContext.Current.Session" vs Global.asax "this.Session"

Recently, while working on some code for an ASP.NET project at work. We needed a tracking util to take basic metrics on user activity (page hit count etc) we would track them in Session, then save the data to DB via Session_End in Global.asax. I began hacking away, the initial code worked fine, updating the DB on each page load. I wante...

How to know the ordinal position of an ItemTemplate

Need to add styles (class="bBot") to the first ItemTemplate item, how do I know it's the first? <asp:Repeater id="ArticlesRepeater" runat="server"> <HeaderTemplate> <div class="FR boxW380"> <div class="cnt mag"> <div class="FR"> <a href="#">Subscribe</a> &#160;...