Pop Up Window refresh parent

HTML, JavaScript No Comments »

If you have a script that opens up a new window using JavaScript: window.open()

on the child window, if you want to close the window and refresh the parent window, use the following code:

window.close();
if (window.opener && !window.opener.closed) {
    window.opener.location.reload();
}

Sitefinity Custom Download List

.Net No Comments »

Problem: create a file-download-list that you can filter by tag, category, or other criteria

Solution:

  1. create a library and upload your files to it
  2. categories and/or tag the files the way you want them to be filtered
  3. download the following sample code from the Telerik team:
    http://www.sitefinity.com/ClientsFiles/143126_customdownloadlist.zip
    (for more information on this download refer to Telerik’s forum)
  4. add the following customizations to the supplied sample in order to filter by tags or categories:

            if (filterByTag)
            {
                tagFilter = new List<ITag>();
                IList<ITag> alltags = this.manager.GetTags().OfType<ITag>().ToList();
                foreach (Guid g in FromTags)
                {
                    foreach (ITag t1 in alltags)
                    {
                        if (t1.ID.Equals(g)) { tagFilter.Add(t1); }
                    }
                }
            }
            if (filterByCategory)
            {
                categoryFilter = new List<ICategory>();
                IList<ICategory> allcats = this.manager.GetCategories().OfType<ICategory>().ToList();
                foreach (Guid g in FromCategories)
                {
                    foreach (ICategory c1 in allcats)
                    {
                        if (c1.ID.Equals(g)) { categoryFilter.Add(c1); }
                    }
                }
            }

now you have a custom download list that filters by Tags or Categories.

I have only tried this code on a Sitefinity 3.7 Standard site, I don’t know if it is compatible with other versions.

Fix ASP.net menu in Safari and Chrome

.Net, HTML No Comments »

If you use the standard ASP.NET menu (or toolbar) in your web application, it works well in most browsers except for Safari & Chrome. In these 2 browsers, each menu item appears on a new line.

The fix I found was placing the following code in my MaterPage code-behind:
if (Request.UserAgent.IndexOf(“AppleWebKit”) > 0)
        {
            Request.Browser.Adapters.Clear();
        }

If you are not using a Materpage:
protected void Page_PreInit(object sender, EventArgs e)
    {
        if (Request.UserAgent != null && Request.UserAgent.IndexOf(“AppleWebKit”, StringComparer.CurrentCultureIgnoreCase) > -1)
        {
            this.ClientTarget = “uplevel”;
        }
    }

The solution is adapted from this site (Thank you):
http://weblogs.asp.net/joshuajohnson/archive/2008/01/23/how-do-i-overcome-the-dreaded-safari-asp-net-menu-conundrum.aspx

Silverlight on IIS 6

.Net, ASP No Comments »

In order to host a Silverlight application on IIS6 you will need to add a MIME type

  • Open IIS, right-click and select properties for the Silverlight site.
  • Select the tab for HTTP Headers
  • Click on MIME Types
  • Click New and add Extension= .xaml and Mime Type= application/xaml+xml
  • Depending on the features used in your Silverlight app, you might also need to add 2 new types of
    (.xap  application/x-silverlight-app) and (.xbap  application/x-ms-xbap)

Multiple Exchange Accounts in Outlook

Servers No Comments »

I needed to connect to 2 accounts on the Exchange Server from my Outlook 2007. When I tried to add a second account, an error message said it is not supported.

I understand that the upcoming Outlook 10 will have this support built in. In the meantime, I found this article from Microsoft: http://support.microsoft.com/kb/291626 

It describes how you can add a delegate to your second account, then open it under the first account.

Outlook 2007 keeps asking for Password on Exchange 2007

Servers No Comments »

I have a new installation of Outlook 2007 on Windows 7 connecting to Exchange 2007. The client is not in the domain of the Exchange server. I found 2 fixes online, together they fixed the problem.

  1. Close Outlook
  2. Delete any network passwords saved for the exchange server (in Windows 7 click Start and type Network Passwords, click on Manage Network Passwords)
  3. Rename the folder under this path ”%userprofile%\AppData\Roaming\Microsoft\Protect” to something else (I added -old to the end). I got this step from this website, thank you: www.howtogeek.com/howto/windows-vista/fix-for-outlook-2007-constantly-asking-for-password-on-vista
  4. Login to Outlook and check the box to save password

UltraWebGrid Cell and CellItem

.Net No Comments »

if you have an UltraWebGrid with a TemplatedColumn, the TemplatedColumn has a checkbox or any other control. If you want to access the control inside that column here’s what you need to do:

  1. assuming you have a loop cycling through the rows
  2. Dim rw As UltraWebGrid.UltraGridRow = UltraWebGrid1.DisplayLayout.Rows(i)
  3. Dim cl As UltraWebGrid.UltraGridCell = rw.Cells.FromKey("myColumnName")
  4. Dim col As Infragistics.WebUI.UltraWebGrid.TemplatedColumn = cl.Column
  5. Dim ci As Infragistics.WebUI.UltraWebGrid.CellItem = col.CellItems(i)
  6. Dim chk As CheckBox = ci.FindControl("myCheckBoxID")

now you can access that checkbox and do whatever you want with it.

CSS float keep element inside DIV

HTML No Comments »

If you have come across the problem of containing floats, then there’s a simple fix to your problem. Typical scenario, you have an img tag (image) inside a div tag. The img is set to float (left of right), and the div tag is not big enough to contain all the img, so the img sticks out. The solution: hr tag at the bottom of the div tag, with the following CSS:

div.item hr { display: block; clear: left; margin: -0.66em 0; visibility: hidden; }

click here for more info

cell padding problem with older browsers

HTML No Comments »

I came across this problem with older browsers. If your table cell uses percentage for padding, for example:

<td style=”padding-right:1%”>text</td>

then that cell will expand off the screen.

Instead, use pixels for measurement, for example:

<td style=”padding-right:15px”>text</td>

Upload file timeout

.Net, ASP No Comments »

if your webpage submits a file for uploading, and the page returns an error on larger file sizes, then look for 2 attributes to modify in your web.config .

open you web.config file and seach for the following line:

<httpRuntime executionTimeout="480" maxRequestLength="7168"/>

executionTimeout is the time limit before the request timesout and you get an error, this figure is represented in seconds (480 = 8 minutes)
maxRequestLength is the file size represented in KB (1024 = 1MB, 7168 – 7MB)

for detailed info, go to: http://msdn.microsoft.com/en-us/library/e1f13641(VS.71).aspx

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in