Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Discussions

Juan Venter lesmemphis
  • Splash screen ​compatibili​ty issues

    I've got a splash screen that displays before the default page is loaded for my website.

     

    It displays perfectly in IE, but not in firefox. How do you add a splash screen in firefox?

     

    (let me know if you need to see the code)

  • Horizontal window error

    figuerres said:

    Hmmm

     

    how are the menus built and displayed?

    i wonder if you have possibly an optional style sheet for IE that is not geting downloaded on the live site?

    or some javascript that is for IE as a menu helper?

     

    thats what i would check first as you say firefox is ok and many menu designs use alternate css to handle IE6 issues.

     

    Hey,

     

    thanks, I'll check into it and let you know if I resolved the issue.

  • Horizontal window error

    I've got the wierdest bug :

     

    When I run my website from my local host, everything works fine, but when I run the website live from a web server, IE renders my dropdown menu as blank. It still works fine on Firefox etc, but not in IE when live. As I mentioned, IE is fine when on local server.

     

    What could be the cause of this, and how can I solve it?

  • Calling server side script using a for loop

    spivonious said:
    W3bbo said:
    *snip*

    Not to get the thread too far off track, but doesn't StringBuilder only show performance gains at 100+ concatenations?

    Actually...i will be concatenating way beyond 100, so I'll definately be looking at the string builder.

    Thanks!

     

    For each venue i'm loading to the map, there has to be an ID, name, gps co-ordinates, and address. There will within the next 2 months be over 100 venues loaded to this map.

     

    I really do wish i knew how to directly assign an array from code-behind into a javascript array!

  • Calling server side script using a for loop

    W3bbo said:

    I assume this is a C# ASP.NET website and you're making use of the page render function in your <% %> blocks.

     

    Since you want to get a server-side array into a client-side array, just do this:

     

    Define some function in your page's superclass (aka codebehind) like so:

     

    protected String ToEcmaScriptArray<T>(T[] items) {

     

        StringBuilder sb = new StringBuilder();

        sb.Append(" [ " );

        for(int i=0;i<items.Length;i++) {

            sb.Append("\"");

            sb.Append( items[i].ToString() ); // if T is a string, you might want to enclose this in quotes

            sb.Append("\"");
            if( i != items.Length - 1 ) sb.Append(", ");

        }

        sb.Append(" ] ");

    }

     

    ///////////////////////////

     

    then just do this in your client-side script:

     

    var array = <%= ToEcmaScriptArray( marker ) %>;

     

    which will be rendered as a Javascript array literal like so:

     

    var array = [ "marker1", "marker2", "marker3" ];

     

    the penny just dropped. Thank you so much! I'm just going to build a string in code behind and use .split to save it into idividual array elements!

     

    It's basically the same as you did, except i'll just use normal string concatenation in the code behind and call that string.

  • Calling server side script using a for loop

    I'm trying to load location marker for google maps, using data called from a db using code behind.

     

    var array = new Array();
    var num = "<%=numMarkers%>";

    for (j = 0; j<num; j++)
    {
        array[j]= "<%=marker[]%>";
    }

     

    my problem lies with the script <%=marker[]%>, i need to have j's value in the brackets, but concatenation does not work. how do i dynamically step through the enumeration from the client side?

     

    Help will be very much appreciated! Thanks!