Nifty tidbits

Nifty tidbits and random thoughts on technology and anything else that catches my fancy

Archive for the 'Web' Category


Upgrade blues - upgrading to Firefox 3 final from Firefox RC 3

Posted by Raghu on June 17, 2008

As evident from other posts here - have been keenly waiting for the FF 3 final. Imagine my surprise when the “Check updates” didnt find an upgrade! (I’m on FF3 rc3).

Anyway, so off I went to Mozilla.org and downloaded a copy of the final - and did my bit towards FF download day. Happily installed it - all defaults as usual. Install told me that it was installing into the same location as my current installation (c:\program files\mozilla firefox 3 beta 1 - that’s where my FF3 install have been going  - all the way from b1 to b5 and then from rc1 to rc3 - so no surprise).

Well, installation completed successfully, and I started FF 3 - but my title bar still says Build 2008052906 - even the file version has the same build ID.

Something’s up - don’t know what yet - but has anyone else had a similar experience?

Posted in Firefox, Web | 2 Comments »

Firefox 3 beta 5 released. Yahoo Mail is still broken.

Posted by Raghu on April 2, 2008

Firefox 3 Beta 5 release today. Release notes and downloads here.

Installed it as soon as I got to know today morning and the first thing to check was whether Yahoo Mail still crashed. Initially, Yahoo Mail seemed to work alright for all of 50 seconds - quickly moving over items in inbox caused Firefox to crash :-(

Guess will wait for some more time. I’m sure there’s a bug report somewhere on this - Yahoo mail was broken on Beta 2, got fixed in Beta 3, then was broken in Beta 4  and is still broken on Beta 5.

Will wait for it to be fixed - Any idea if this is a firefox issue or a Yahoo! issue? Seems odd that script can cause the browser to crash so badly.

Posted in Firefox, Web | 4 Comments »

For the most part, I find ASP.NET far more easi…

Posted by Raghu on April 11, 2005

For the most part, I find ASP.NET far more easier to use than Java. But the ONE BIG THING where I’ve found ASP.NET sorely lacking is in the support for page templates.

Page templates, if you need to brush up, allow you to define common layout and contents for a web site. Furthermore, once defined, its easy to change the layout and or move your default items around the place.

Basically, what you need is to be able to define a template page with the different areas (header, left pane, main content, footer etc). So the template page controls what is shown where. In addition, you also define the default content for all these areas.

Now each page in the application just overrides the content for the main area (assuming that the defaults are fine for the rest of it). WOW!!!

Java’s had this quite some time - Jakarta Struts has something called Tiles which does exactly this.

For .NET, as I mentioned, the need’s going to be fulfilled with v2.0 of ASP.NET. Meanwhile, if you feel the idea’s great and there’s no point in waiting for v2.0, release, do take a look at MasterPage as www.asp.net control gallery. Do note that since the asp.net team has released this control, there’s a good chance that most of the features will end up in asp.net 2.0.

There are a few shortcomings of the control though - you’ll get a hang of them if you read the posts. Paul Wilson has a version which overcomes these - and best of all, he releases the control with source :). You can find it here.

Posted in ASP.NET, Web | No Comments »

The ASP.NET validation summary is great for dis…

Posted by Raghu on April 8, 2005

The ASP.NET validation summary is great for displaying all the errors in the page. It would be nice though to be able to use a validation summary to display errors that occur on the server side.

A typical scenario is when you have a page that does a search and then displays the results of the search. For the case where no results are found, it would be nice to be able to display the results in our custom validation summary control. It takes away the need to handle the display of the error message in a validation summary control.

This is what you can do about it - implement the IValidator class


public
class CustomErrorMessage:IValidator
    {
        privatestring message;
        public CustomErrorMessage()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        #region IValidator Members

        publicvoid Validate()
        {
            // TODO: Add CustomErrorMessage.Validate implementation
        }

        publicbool IsValid
        {
            get
            {
                returnfalse;
            }
            set
            {
                
            }
        }

        publicstring ErrorMessage
        {
            get
            {
                
                return message;
            }
            set
            {
                this.message = value;
            }
        }

        #endregion
    }

And here’s code to use the validator at runtime in response to a server side error.

CustomErrorMessage msg = new CustomErrorMessage();
msg.ErrorMessage = “No rows found”;
ServerErrors.Visible =true;
ValidationSummary1.Visible = false;
Page.Validators.Add(msg);

Page.Validate();

Posted in ASP.NET, Web | No Comments »

The ASP.NET validation summary is great for dis…

Posted by Raghu on April 8, 2005

The ASP.NET validation summary is great for displaying all the errors in the page. It would be nice though to be able to use a validation summary to display errors that occur on the server side.

A typical scenario is when you have a page that does a search and then displays the results of the search. For the case where no results are found, it would be nice to be able to display the results in our custom validation summary control. It takes away the need to handle the display of the error message in a validation summary control.

This is what you can do about it - implement the IValidator class


public
class CustomErrorMessage:IValidator
    {
        privatestring message;
        public CustomErrorMessage()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        #region IValidator Members

        publicvoid Validate()
        {
            // TODO: Add CustomErrorMessage.Validate implementation
        }

        publicbool IsValid
        {
            get
            {
                returnfalse;
            }
            set
            {
                
            }
        }

        publicstring ErrorMessage
        {
            get
            {
                
                return message;
            }
            set
            {
                this.message = value;
            }
        }

        #endregion
    }

Posted in ASP.NET, Web | No Comments »

Been tinkering with getting a nice paging algor…

Posted by Raghu on April 7, 2005

Been tinkering with getting a nice paging algorithm out. To get a basic hang of the problem, do take a look at



Many ASP developers create their own search engines that return back the results to the web browser one page at a time

Do take a look at the second query given. I’ve modified it a little bit so that you can sort by a given field and removed a bit of the cruft (the au_lname like ‘%A%’ bit). Here the table used is called Pager - with a column called Name.

Some of my bare bones requirements for a paging system are:

1. Should allow sorting

2. Should not impose any requirements on the table schema/ resultset.

3. Should be done on SQL Server as much as possible. Definitely not default paging that results in all rows being sent to the middle layer.

4. Ideally, should not require dynamic queries. (Though note that this conflicts with 1 & 3 as these two requirements almost make dynamic queries mandatory).

5. Should not use temp tables.

declare @pagenum int
declare @pageSize int

set rowcount  @pagesize

select * 
   from Pager P
where
    (select count(*)
    from Pager P2
    where P2.Name <= P.name) > @pagesize * @pagenum
order by
       p.name

 

Posted in ASP.NET, Web | No Comments »