June 2007 - Posts

MAC Users: If you are using a MacBook, you can still install Access 2007 and Expression Web but it is a lengthy process (3 hours):

1. Run all updates. 

2. Use the Bootcamp software in Mac OS 10.5 - Leopard or install Parallels (www.parallels.com). My opinion is that Parallels is the better option even though it costs $80.

3. Install Windows XP (Windows Vista should work but XP will be safer and faster).

4. Install any windows software that you want (including Access 2007 and Expression Web). 

Posted by gcastner | 1 comment(s)
Filed under: ,

When working with ASP.NET pages, one difficulty that often arises is that you need two forms on the page - the normal form required by ASP.NET and a second form for something else such as a PayPal button or a search tool. The solution that I discovered is to not have two forms but simply have one form (the normal one in the master page). It usually only requires some minor changes to the controls in the 2nd form for it to work. For example, here is the adjusted code for a PayPal Buy Now button:
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="gcastner@asianfoods.com" />
<input type="hidden" name="item_name" value="Sweet and sour sauce"/>
<input type="hidden" name="item_number" value="SAUCE001" />
<input type="hidden" name="amount" value="100.00" />
<input type="hidden" name="no_shipping" value="2" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="lc" value="US" />
<input type="hidden" name="bn" value="PP-BuyNowBF" />
<img alt="" style='border:0px;' src='https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
<asp:Button ID="Button2" runat="server" Text="Button" PostBackUrl="https://www.sandbox.paypal.com/cgi-bin/webscr" />

The main changes from the PayPal supplied code are the removal of the form tags and the inclusion of the asp:button. The reason for the change is that because ASP.NET pages are already web forms, we cannot simply add a 2nd form into the page (it would cause an error).

Another useful thing is that you can set the default button for the page, or different parts of the page. This example sets the default button when someone presses enter to the login button rather than the search button at the top of the page. You need to enclose the relevant controls in a panel control.

  Protected Sub panelLogin_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles panelLogin.Load

    Page.Form.DefaultFocus = Login1.FindControl("UserName").UniqueID
    Page.Form.DefaultButton = Login1.FindControl("LoginButton").UniqueID

  End Sub

Posted by gcastner | with no comments
Filed under: ,