PostBackUrl And SmartNavigation Bug?

I have a page with SmartNav, that contains a linkbutton with a
PostBackUrl.

I have found that the page that is the target of the PostBackUrl will
have it’s postback property fired 2 times, and unfortunately, the 2nd
time it is fired the “PreviousPage” is set to Nothing.

I have posted a few places to see if someone from MS can confirm this is a bug, but  I am betting they are going to tell me to not use smartnav.

SQL Server Merge Replication

One of the challenges in doing merge replication in SQL Server is dealing with IDENTITY columns.

One of the tricks you can use is “automatic identity range management”. 

Basically you tell DB 1 to start at seed 1 and DB 2 to seed at 20,000, and when DB 1 reaches 16,000 or DB 2 reaches 36,000 it will reset those seeds to 40,000 and 60,000.

http://msdn2.microsoft.com/en-us/library/ms152543.aspx

http://msdn2.microsoft.com/en-us/library/ms146907.aspx

It appears to work well.

Getting IE To Print Backgrounds And Cell Colors

I was having a small problem getting some reports to print the way I wanted.

I turns out that to get the table cells colored backgrounds to print, click on the browser’s Tools menu. Select Internet Options, then click on the Advanced tab. Scroll down to find the Printing heading and check the box called Print Background Colors and Images. This setting affects both page backgrounds and table cell backgrounds.

Using XSD.exe

.Net has a tool called the XML Schema Definition Tool (XSD.EXE) which can turn XSD schemas into classes.  Also, it will try to make it so those classes will conform to the schema when serialized as XML.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpconxmlschemadefinitiontoolxsdexe.asp

xsd.exe pathToXSD.xsd /classes /language:VB /outputdir:C:output

You can then serialize and deserialize the object into/from XML.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlSerializationXmlSerializerClassTopic.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlSerializationXmlSerializerClassDeserializeTopic.asp

 

 

Is The Date On The Weekend

This function will figure out if the given date lands on a weekend.

    Public Shared Function IsWeekend(ByVal dateOfInterest As DateTime) As Boolean
Dim d, m, y, w As Integer
d = dateOfInterest.Day
m = dateOfInterest.Month
y = dateOfInterest.Year


If m = 1 Or m = 2 Then
m += 12
y -= 1
End If


w = CInt((d + 2 * m + 3 * (m + 1) / 5 + y + y / 4 - y / 100 + y / 400) Mod 7)
If w <> 6 And w <> 7 Then
Return False
Else
Return True
End If
End Function

Another function to do the weekend check could be this:

    Private Const ERR_INVALID_DATE = 20000
Private Const ERR_INVALID_DATE_MSG = "Date Required"

Public Function IsWeekend(ByVal DateValue As Object) As Boolean

Dim dDateValue As Date

If Not IsDate(DateValue) Then
Err.Raise(ERR_INVALID_DATE, ERR_INVALID_DATE_MSG)
Exit Function
End If

dDateValue = CDate(DateValue)
IsWeekend = (Weekday(dDateValue) Mod 6 = 1)

End Function

Using Postbacks in ASP.NET From showModalDialog pages.

If you have an ASP.NET page (.aspx) opened with the JavaScript showModalDialog() function and inside that page there is a form doing PostBack, when the PostBack is being done the page loads in another (popup) window. The easiest way to prevent this is to add the following tag inside the <HEAD></HEAD> tags of the ASP.NET page:

<base target=”_self”>

From: http://www.geekpedia.com/Question23_Using-showModalDialog()-with-an-ASP.NET-page-that-does-PostBack-opens-another-window.html

Databinding "Bind()" in ASP.NET

If you used the developemt tools to create a datagrid in ASP.NET 2.0, it will show something like:

NavigateUrl=’<%# Bind(“EmployeeId”) %>

But what if you wanted to do something more complicated that just ge the EmployeeId into the field, like for example if you wanted to run a JS function.  Then you have to do away with Bind and use the more verbose DataBinder method like this: 

NavigateUrl=’<%# “javascript:UseThisJobIndex(” & DataBinder.Eval(Container.DataItem,”JobIndex”) & “)” %>

That’s all there is to it.

 

My Very Educated Mother Just Said Uh-oh No Pluto!!

http://msnbc.msn.com/id/14489259/

I wish I coudl take credit for that line, but it was from Colbert.

So now Pluto is going to be a Drawf Planet, along with UB313 (Xena) and Ceres.


To see the full image you might need to expand your window or use the scrollbar at the bottom of this article.

UB313 is larger than Pluto, and farther out in orbit.

I kinda liked the idea of calling Pluto and Charon a “dual planet,” as Charon is so large that it was somewhat unfair to say that it orbits Pluto, but they aren’t going to do that.

Ceres is the largest asteroid in the Asteroid Belt but because it hasn’t swept the area clear of other asteroids (and I guess it never will b/c of its close proximity to Jupiter) it will never meet the new definition of a planet:

“a celestial body that is in orbit around the sun, has sufficient mass for its self-gravity to overcome rigid body forces so that it assumes a nearly round shape, and has cleared the neighborhood around its orbit.”

Backup/Restore Cisco Pix Configuration

To do this you

  1. Need a TFTP server running (solarwinds)
  2. Need to telnet into the device
  3. Need to be in enable mode

First to make the backup:

write net 192.168.1.2:MyBackup.pixconfig

where the IP is the IP of your TFTPserver

Then to restore it later, you need to enter config terminal mode first and then restore the file:

config term
configure net 192.168.1.2:MyBackup.pixconfig

and there you have it…

The changes will take immediate effect, but you will still need to write them into the non volatile memory, or the changes will be lost when you reboot the device.