Life, Surf, Code and everything in between
White Papers | Free Tools | Products | Message Board | News |

Last 24 Comments

re: jQuery Books Review
Yesterday @ 1:55 pm | by Rick Strahl

@John - yes you definitely can use ASPX pages with this. I'm finishing up an article on this topic as we speak (hopefully online next week) or you can download my recent DevConnections Sessions which has examples that show how to do this.
re: Creating a scrollable and grouped Repeater Layout
Yesterday @ 12:36 pm | by Rob

I know this is an old post, but I come across your blog for tons of stuff and really appreciate you putting your knowledge out there.

One tweak I do with the grouping is to make RenderGroup return a bool:

<tr runat="server" visible=<%# this.RenderGroup("TheColumnGroup") %>
<td>My Group Only content</td>
</tr>
<tr>
<td>My Standard Content</td>
</tr>
(substitue divs or asp:Panel for the same non-table effect)

Same idea, just independent from CSS.
re: ASP.NET Connection Session Slides and Samples Posted
Yesterday @ 12:29 pm | by JOHN PARLATO

Hey Rick, can you post the mdf file for Using jQuery with ASP.NET in sql express 2005 as many of us don't yet have sql server/express 2008?
re: Handling mshtml Document Events without Mouse lockups
Yesterday @ 12:22 pm | by Bob Pfeffer

Hi,

This is in response to Stephan Lips. He is getting the Invalid Cast exception.

From some testing I did, Jack L. is correct. It is thread related. I found that the only thread I could reference the document.parentWindow property was from the Main thread (the first one created by the CLR). I am not sure about accessing other properties from other threads.

At first I tried attaching to the document from a thread I created. I used this thread as the only one I referenced the document properties. It was able to reference all properties EXCEPT the parentWindow. However even in this scenario, I was able to reference the parentWindow property from the main thread.

The trick is that the events caught by the handler described above are running on another thread it seems specifically created just to handle the event! If you reference the parentWindow property from this thread you get the Invalid Cast Exception. You have to get the code needed to handle the event running in the main thread. If it is windows form application, you can use the control.Invoke method. Otherwise you need to create some means of switching to the main thread to execute your event code.

I did this by creating a queue of items that has an instance of a delegate pointing to the event logic, any parameters, a return value, and an 'done' autoresetevent. The main thread sits in a loop waiting on an 'itemisqueued' autoresetevent. When an item is queued the 'itemisqueued' autoresetevent is set, and this thread waits for the 'done' autoresetevent to be set. The main thread then pulls the entry off the queue, invokes the routine pointed to by the delegate, saves any return value and then sets the 'done' event and waits for another item on the queue. Of course the main thread is only servicing this queue and not much else.
re: jQuery Books Review
Yesterday @ 11:56 am | by JOHN PARLATO

Rick, I'm very interested in learning jquery... I need to know how I can use it with aspx pages, outside of mvc... is that possible too? I'm finding examples with .jsp and mvc, but no aspx webforms? Any advice for me or pointers to some samples/books?
re: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
Yesterday @ 5:48 am | by Atef Elkabani

I have faced the same problem.

that because you can't add control

"Me.Master.FindControl("form1").Controls.Add(ctrl)"

to a form that have block (<% ... %>)

The best solution is to remove that block and try other solution
like add server side control

e.g

<a runat="server" id="lnkHome">

lnkHome.href= session("linkTitle") 'vb Code

instead of

<a href="index.aspx"><%= session("linkTitle") %> </a>
re: ASP.NET Connection Session Slides and Samples Posted
Yesterday @ 4:46 am | by Craig Serold

Thanks Rick. I tried to attach it to attach but kept getting the same version error message. I had a friend attach it to 2008, export the tables to 2005. He sent me the MDF and everything started working fine....weird.

I've really enjoyed going through the projects and code. Have you settled on a solution for Modal windows. I saw that you implemented something custom. I've also looked at jqModal and the "dialog widget" in the JQuery UI. Wanted to see if you had an opinion.
re: ASP.NET Caching under Memory Pressure
Yesterday @ 2:04 am | by Edmartinez

Hi Rick! There is added pressure on memory due to ASP.NET cache’s in-process and standalone nature. I suggest you look into distributed caching because it not only relieves the pressure on memory, but it is also scalable and highly reliable.
re: ASP.NET Connection Session Slides and Samples Posted
Tuesday @ 11:26 pm | by Rick Strahl

@Craig - thanks. Updated. Not sure how this happened - somewhere in my final cleanup of the project I guess.

The database is V 9.0 (SQL 2005). You just may have to attach it explicitly. I've had problems with getting it to work properly due to permissions in some situations in 'file mode'. The sample should work out of the box with file mode connection and the local Web server though.
re: I hate Adobe Acrobat (even more now!)
Tuesday @ 3:01 pm | by Tom the Tom

Stupid lawyers sending stupid PDFs. I'm going to cry if I have to convert another PDF.
re: LINQ to SQL and attaching Entities
Tuesday @ 11:39 am | by Rick Strahl

@Mike - Interesting, but it doesn't really solve the problem if you're dealing with an existing entity that you want to update - it works only if you manually reassign all values. Also you still end up with issues for child entities, which in the end is the real problem.

It's interesting to see all the different approaches that have been mentioned in this thread. Obviously there are ways this can be done - iit'd just be nice if Microsoft would at least take one of these approaches and automate it behind the scenes.
re: LINQ to SQL and attaching Entities
Tuesday @ 9:42 am | by Mike Russo

I follow yur articles alot ... anyways after some digging I was able to figure out how the Attach works without doing a pre-fetch ...

Within my middle tier function I have this code ...
            using (var context = GetContext())
            {
                Company company = new Company(companyId);
                context.Companies.Attach(company);
                company.UserName = userName;
                company.Password = password; 
                company.EMail = email;
                company.Notes = notes;
                context.SubmitChanges();
            }


First, the Attach should be called before you set any properties ... second if you set the PK property you get an exception so what you do is add a new contructor via partial class ...

    partial class Company
    {
        public Company(int companyName)
        {
            _CompanyId = companyName;
        }
    }


This bypassed the PropertyChange ... it has worked out well for me ... however I also use VS2008 and latest .NET Framework
re: Introduction to jQuery Article posted
Tuesday @ 9:35 am | by Helen from Online Book Reviews

Thanks Rick, this is an awesome intro to JQuery -
I have been playing on getting a copy of JQuery book and reading it, this has done a great deal to show what can be achieved with it.

Lovely site by the way :)
re: Running VisualSVN Server for Subversion Source Control
Tuesday @ 8:54 am | by Ivan Zhakov

Good practice use httpd-custom.conf to customize VisualSVN Server, because it will not be overwritten on upgrade/reinstall. Just add something like this:
<Location /svn/>
Satisfy Any
<Location>
re: Updated jQuery Calendar to jQuery DatePicker
Tuesday @ 1:31 am | by Andrew

I conducted investigation about this problem. Bug is : control need only en-US Culture. So fix is:
wwWebUtils.cs, internal class wwWebUtils, line 199
public static string EncodeJsDate(DateTime date)
        {
            return "new Date(\"" + date.ToString("U", new CultureInfo("en-US")) +" UTC" + "\")";
        }

re: Where's my .NET 3.5 (on IIS), Dude?
Monday @ 9:09 pm | by VPDJ

Thank you for the info. Guys check this out - www.mono-project.com
re: FireFox 3 and Static File Caching Problems
Monday @ 7:24 pm | by G

To add to the frames-confusion, i suspect might that firefox3 sometimes reloads a frame twice, if you use the classical: parent.frame2.location.href = 'newpage.asp'.
Would be interesting to hear anyone verify this, since it only happens in firefox3. Is this a known problem?
re: jQuery Intellisense Updates from Microsoft
Monday @ 5:42 pm | by Godwin

Any signs of similar support for prototypa/Scriptaculous?
Thanks
re: Odd Word Problem - Home and Delete keys not working
Monday @ 2:40 pm | by Christine

I had this problem with the Backspace key not deleting. After installing a translation software, I had to use CTRL or ALT + Backspace to be able to delete (ant then, again, it was deleting the whole word and not only one character...) So, I've been in Tools - keyboard commands and discovered that Backspace had been dedicated to another thing... I deleted that, and everything seems to be back to normal! Thanks for the great idea! I've been looking for a solution all day!
re: Creating Thumbnail Images on the fly with ASP.Net
Monday @ 1:33 pm | by Nikola

Great code! Thanks! :)
re: ASP.NET Connection Session Slides and Samples Posted
Monday @ 1:21 pm | by Craig

Rick, I think ui.draggable.js may be missing from the jQueryWeb project.
re: Sql 2008 Management Tools: Can't save changes that require Recreation of Database
Monday @ 12:47 pm | by joan pons

who the hell at microsoft decide to put this stupid settings on ?
anyway, thanks rick!


West Wind  © Rick Strahl, West Wind Technologies, 2005 - 2008