Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3231198
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:01:01+00:00 2026-05-17T17:01:01+00:00

Consider a page, when the page loads, nothing shows up. It works when i

  • 0

Consider a page, when the page loads, nothing shows up.

It works when i pass the querystring on the browser as this:

http://localhost:51765/foo/foo.aspx?ID=c516f4f4-36a9-40a7-baad-d2419ea631b9

I want it to work when the page load not when i pass the querystring on the browser.

Can someone help me with this?

<asp:SqlDataSource ID="categoriesDataSource" runat="server" 
     connectionString="<%$ ConnectionStrings:ConnectionString %>"
     SelectCommand="SELECT [CategoryID], [Name] FROM [Categories] WHERE ([UserId] = @UserId) ORDER BY [Name]">
     <SelectParameters>
          <asp:QueryStringParameter Name="UserId" QueryStringField="ID" />
     </SelectParameters>
</asp:SqlDataSource>

<asp:DropDownList ID="categories" runat="server" AutoPostBack="True"
       DataSourceID="categoriesDataSource" DataTextField="Name" 
         AppendDataBoundItems="True" DataValueField="CategoryID">
        <asp:ListItem  Value="">-- All Albums --</asp:ListItem>
</asp:DropDownList>

 <asp:SqlDataSource ID="picturesDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
      SelectCommand="SELECT [PictureID], [Title], [UploadedOn] FROM [Pictures] WHERE UserId = @UserId AND 
       (CategoryID = @CategoryID Or @CategoryID IS NULL) ORDER BY UploadedOn DESC" 
        CancelSelectOnNullParameter="False">
  <SelectParameters>
      <asp:ControlParameter ControlID="categories" Name="CategoryID" PropertyName="SelectedValue"/>
      <asp:QueryStringParameter Name="UserId" QueryStringField="ID" />
  </SelectParameters>
</asp:SqlDataSource> 


<asp:GridView ID="GridView1" runat="server" DataSourceID="picturesDataSource">
</asp:GridView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:01:01+00:00Added an answer on May 17, 2026 at 5:01 pm

    It is difficult to answer your question without showing the code of the page or at least explaining what it does. From the url it seems that the page relies on the ID parameter and tries to parse it to a Guid. You need to test whether the ID parameter is passed and use it only in this case:

    string id = Request["ID"];
    if (!string.IsNullOrEmpty(id))
    {
        // The ID parameter has been passed => use its value here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider this page: http://losthobbit.net/temp/docking.html Here's the HTML: <html> <head> <title></title> </head> <body> <div style=position:
Consider this scenario: <asp:CheckBoxList> in a master page. the goal is to have all
Consider this problem: I have a program which should fetch (let's say) 100 records
Consider these two function definitions: void foo() { } void foo(void) { } Is
Consider the following code: public partial class TeacherControlPanel : System.Web.UI.Page { protected string username
Consider a page with the following code: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN
Consider a page webapp/myPage.xhtml : ... <h:form id=myForm> ... <h:selectOneMenu id=... required=true value=#{myController.aValue}> <f:selectItems
Consider the following scenario: Page written in classic ASP or PHP, which is rendering
Consider the following code: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Consider the following setup: A windows PC with a LAN interface and a WiFi

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.