View Complete Thread
  • if statement dosen't parse properly

    Jul 07, 2010 11:52 PM|rickj1|LINK

    I did this tutorial

    it uses this if statement


    @if (Request["TwitterUser"] == null) { @Twitter.Profile("microsoft")


    else {




     when I first load the page the Twitter feed is from microsoft when I type another name

    that feed comes up fine but when I click on submit with empty text I get the yellow screen of death

    with this exception

    Line 26:             else { 
    Line 27:
    Line 28:                 @Twitter.Profile(Request["TwitterUser"]) 
    Line 29:
    Line 30:             }

    [ArgumentException: Value cannot be null or an empty string
    Parameter name: twitterUserName]
       Microsoft.WebPages.Helpers.Twitter.Profile(String twitterUserName, Int32 width, Int32 height, String backgroundShellColor, String shellColor, String tweetsBackgroundColor, String tweetsColor, String tweetsLinksColor, Int32 numberOfTweets, Boolean scrollBar, Boolean loop, Boolean live, Boolean hashTags, Boolean timestamp, Boolean avatars, String behavior, Int32 searchInterval) +454
       ASP.index_cshtml.Execute() in c:\Users\Owner\Documents\My Web Sites\HelloWorld\index.cshtml:28
       Microsoft.WebPages.WebPageBase.ExecutePageHierarchy() +152
       Microsoft.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase initPage) +33
       Microsoft.WebPages.WebPageHttpHandler.ProcessRequest(HttpContext context) +337

    Beta Junky