asp.net

Best Practices in setting up a Blog data model

I have the following setup for my Blog Data Model: Blog Articles Categories ----- -------- 1 ---------- ID \ 1 * ID /----- ID Name \------------ BlogID / Name Owner Name * / CategoryID-/ I'm worried about how ...

How to get a CSS class property value in code behind

How can I get the value of a style defined in a CSS class? The markup has: CssClass="grdTextBox" Text="aaaaaaaabbbbbbbccccccc" The CSS style is: .grdTextBox {FONT-SIZE: 12px; FONT-FAMILY: verdana; } The .cs file has: string cssClass = txtComments.CssClass; Response.Write(" cssClass is : " + cssClass); How can I find the value...

Tag system with search for .NET (and ASP.NET)

Is there a good tag search system that i can use in my C# .NET prototype that will also run on ASP.NET ? ...

Should dynamic asp.net controls be avoided

Should dynamic asp.net controls be avoided at all costs? In what situations should they be used? What do you use as their replacement? ...

Why is <deny users="?" /> included in the following example?

Hello, (?) wildcard represents unauthenticated users while (*) represents all users, authenticated and unauthenticated. My book shows the following example of URL authorization: <authorization> <deny users="?" /> <allow users="dan,matthew" /> <deny users="*" /> </authorization> But doesn’t the above code...

Controlling access to specific files via <location>

Hello, A) We can also control access to specific files using <location> tags. Why aren’t <location> elements contained inside <system.web> tag, but are instead nested directly inside <configuration> element? B) I realize <system.web> element is used for Asp.Net settings, but why does <location> also contain <system.web>? Is it so...

Regular Expression (C# flavor) to fetch first <p></p> after heading tag

I'm nearly done with a trackback system for my website, but have one last niggling regular expression I just can't get right. What I'm after is an excerpt of the referring page, where I'm defining the most relevant excerpt as: The first paragraph (marked by <p></p> tags) that follows either an <h1></h1>, <h2></h2> or <h3></h3> in the H...

Multiple user controls on a aspx page

I have a page that dynamically loads multiple user controls on a page. I have a few buttons on each user control that cause a server side event that does some processing related to the user control that triggerred the action. The problem I run into is that this button click causes the entire page to reload (as all the dynamically loaded...

Nesting content in user controls

okay so this is probably a soft pitch question for sombody, but I want to be able decratively drop some content into a control like so: <uc1:floatingControl id="myFloatingControl" runat="server"> <floatingContent> Hello world<br /> <asp:button id="arbitraryASPControl" runat="server" /> <uc2:arbiratryUserControl id="foo"...

IIS Recompile ASP NET websites

hello, i was talking with a friend about what iis does when u put a new file inside a virtual directory. he tolds me that IIS recompile the entire website when u put a file anywhere in the website, i think it just happens (if happen) when u put a file inside your Bins folder. the conversation comes because a website in the company is ...

Handling a dynamic Connection String with DAAB

I'm in the process of adding a Data Access Layer for our ASP.Net 2.0 web application that was written almost exclusively using in-line SQL calls and copious use of copy/paste. Due to business concerns I am only able to re-factor small portions of the application at a time (can't settle in and do a huge re-design), so I have to live with ...

How do you write to the Log tab and Console.Error tab of the NUnit gui runner

In the NUnit Gui Runner, there are 6 tabs. I can write to the Console.Out by writing something like: Console.WriteLine("This will end up in the Console.Out"); I can write to the Trace tab by writing something like: System.Diagnostics.Trace.WriteLine("This will end up on the Trace tab"); But how do I write to the two other tabs, "...

Synchronous database reads inside IHttpAsyncHandler

On asp.net if i call a synchronous database query inside an IHttpAsyncHandler with delegate.BeginInvoke, would it still release the asp.net worker thread while reading the database? For example, this post: http://madskristensen.net/post/How-to-use-the-IHttpAsyncHandler-in-ASPNET.aspx If i put a synchronous database call inside ServeCon...

asp.net session timeout

how do i set the session timeout in asp.net ? thru the code and thru the web.config (i heard that you can do it here). thanks ...

asp.net formatting dateTime in gridview

I'm binding a gridview dynamically from a table in my database I have called "Sessions". I get the information from a method using a linq query that is something like this: var s = from sessions in datacontext.Sessions where sessions.test == id orderby sessions.ID ascending se...

Struggling with acceptable use of Session variable in ASP.NET

I tried to wean myself of lopping everything in a Session variable in ASP.NET (I came from a Windows programming background), and I generally completely stopped explicitly storing anything in a Session variable. Can anybody give some guidelines as to what you feel are acceptable uses of session variable? Here's a specific example...I l...

How to work with TimeZone in ASP.NET?

I am working on an "online reminder system" project (ASP.NET 2.0 (C#) / SQL2005) As this is a reminder service which will send the mail to users on a particular dates. But the problem is users are not from a specific countries, they are from all over the world and from different time zones. Now When I am registering I am asking for user...

Problem with SmartNavigattion property

When I set the SmartNavigation property to true I can't set location.href to an anchor tag through code. Is there a way to handle this in ASP.Net 1.1. ...

Showing a list of objects in asp.net mvc

I am new to MVC. I am developing an web application in asp.net MVC. I have a form through which users can get registered, after registration user redirected to ProfileView.aspx page. till here everything is fine. Now I want to show the articles headings posted by that user right under his profile. Right now I m using following code: pu...

Why do I am getting "Platform Not Supported Exception" while adding new Response Header?

Why do I am getting "Platform Not Supported Exception" while adding new Response Header? I am debugging website using Visual Studio webserver. code: Response.Headers["X-XRDS-Location"] = url Exception Message: "This operation requires IIS integrated pipeline mode." Any help would be appreciated... ...