asp.net

ASP.NET MVC web.config (multiple) issue

Hi, i'm having problems running my MVC project on my server. The main project on the server has it's own web.config file (1.0 versions referenced in configsections), while the 'virtual subproject' also has one (3.5 versions referenced). I receive the following error: Configuration Error Description: An error occurred during the proces...

C#: GridView, Row-By-Row Operations

I have a grid view displaying the messages a user has. Each message the user has is being marked whether it has been read or unread as a bit in my database table. Is there a way how I can change the style of certain rows in my grid view according to whether the messages are read or unread? I wish to display the whole row with an unread...

Generating a file, then launching a secure download

Working in an asp.net 2.0 (VB) environment, I already have code that can generate an excel file from a database for a particular "user" of the website. I want to be able to launch this report generator on demand, and then after the file has been generated, allow the user to download this file. How can I do this securely, and not just ...

Testing a Container.DataItem with inline code

I would like to do something like this in ASP.Net 2.0: <asp:Repeater id="myRepeater" runat="server"> <ItemTemplate> <% if (DataBinder.Eval(Container.DataItem, "MyProperty").Equals("SomeValue")) { %> <%#DataBinder.Eval(Container.DataItem, "MyProperty")%> <% } %> </ItemTemplate> </asp:Re...

body runat="server" causing compilation error

In a Master Page I have the following markup <body id="body" runat="server"> I have set runat="server" because I need to be able to access the body element in code-behind. I would now like to add a JavaScript function call to the body onload event, like this: <body id="body" runat="server" onload="someJavaScriptFunction();"> Howev...

ASP.net MaskedEdit: Entering number 425.25 produces 4250000000.25. How can I fix this?

I had a NUMBER field in an ORACLE Database that is set to 13,2. I want to use the MaskedEdit field in order to mask this. If I enter 425.25, it produces a 4250000000000.25, instead of moving the 425 over. I'm literally entering 425 pressing the period key and then 25, which moves me into the decimal area of the MaskedEdit. That works gr...

ASP.NET Repeater Paging/Sorting

So what's the real story on how to do this. All of the examples I find use Default Paging (HOW does anybody find that acceptable???) but I want to use custom paging. I can't use a GridView because I need more flexibility. The examples I see all use the PagedDataSource class but I can't find one that uses Custom Paging. Am I doomed to...

What is the importance of DTD and how it affects the display of the web page page

What is the importance of DTD and how it affects the display of the web page page at runtime ...

Using ASP.Net ListView.ExtractItemValues, how do I get the selected item in a RadioButtonList in the ListViewDataItem?

I'm attempting to iterate over the ListViewDataItems in an ASP.Net ListView, and use the ListView.ExtractItemValues to get the values from DataBoundControls. This works fine with ITextControls, but I am having difficulty getting the Selected Item from a RadioButtonList. Here is my markup: <asp:ListView ID="lvQuiz" runat="server"> <Lay...

Server-side detection that a page is shown inside an IFrame

Is it possible to determine - server-side - whether a page has been loaded within an IFrame? When certain errors happen in my application the user gets redirected to Default.aspx and an error message is shown. The text of that error message gets set in session by exception handling code. The error message gets cleared from session once ...

Dynamic XML

What's the ideal way of generating XML without creating and saving a file? I'm thinking of using an ASP.NET page with code behind to generate the markup as XML. Is this possible? Or would you have an alternative way? I have a flash component that reads an XML file and I need to dynamically generate this file. I don't have write permis...

How does one register an assembly in GAC while installation of website?

Hi all. I'm working on a project that depends on third party controls. While opening website after installation, I've an error message regarding these controls, Could not load file or assembly. assembly_file_name. The system cannot find the file specified. web.config file, has an assembly tag for each dll. When I remove these t...

DllImport and ASP.NET

Hi, I'm having some problems with DllImport and ASP.NET because when I use a imported method ASP.NET loads the Dll and locks the file even after it finished using it. Is there any way to force ASP.NET to release the lock on the file? ...

Invalidate another users session variables

I'm thinking of a situation where an administrator makes some changes to another user in the system that happens to be logged in. Is there any programatic way to invalidate that specific users session variables and force them to be repopulated? Use Case Admin Edits Bobs preferences Business Logic clears bobs preferences stored in ses...

ASP.NET Repeater item in a subclass

Here's how I pull a field from my object: <%# DataBinder.Eval(Container.DataItem, "Name") %> However, how do I pull a field if it's in a subclass (Customer.ContactInfo.Name)? ...

PopUp window in IE 6 SSL

Hey all.. I have a weird issue. I am opening a popup window in IE6 with SSL enabled on the server. When the following executes it seems to lock the browser up. I know this is vague. This is the JScript that appears to be the problem. Gotta love your IE6! function PopoffWindow(url) { var features = "height=400,width=550,top=60,left...

Efficient way of truncating a trace file when it gets too big?

I'm using .NET's built-in Tracing mechanism to trace program execution. The problem is the trace file can grow to several MB very quickly. Is there an efficient way of truncating the file when it grows past a certain point? I thought of putting in a check whenever something gets written (I have a custom class that inherits from TraceL...

How do I group items into subheadings in an ASP.NET gridview control?

Hi guys, I'd like to take two tables and populate a gridview with the results: product category I'd like to have the gridview seperated into subheadings by category, rather than as a data field within the product gridview... Something like: (categories: food, clothing, shelter) FOOD Rice 10s Available <buy now> Beans 20s Availa...

WriteStartDocument() problem

I'm trying to generate XML and I encounter this exception: XmlTextWriter xmlWriter = new XmlTextWriter(Response.OutputStream, Encoding.UTF8); xmlWriter.WriteStartDocument(); xmlWriter.WriteStartElement("userInfo"); It gives me an exception: WriteStartDocument needs to be the first call. But as you can see, I did call the Write...

I need help configuring ASP.net Profiles

I'm trying to use ASP.net profiles I've followed some instructions which means I have set up a the ASPNETDB (using SQLExpress 2005) configured the profile provider (in the web.config) defined some properties enabled authentication But I can't seem to use code like (ie Intellisense doesn't like it) Profile.UserCustomContent = "Hi Mo...