Results 1 to 4 of 4

Thread: request.querystring error

  1. #1

    Thread Starter
    Hyperactive Member Grunt's Avatar
    Join Date
    Oct 2004
    Location
    Las Vegas
    Posts
    499

    Post request.querystring error

    I downloaded a custom control from here:
    http://www.codeproject.com/aspnet/dwtabstrip.asp

    it was written in c#, but I have the compile dll so it should work fine in vb...

    Code:
    Imports doug.Components
    Partial Class Main
        Inherits System.Web.UI.Page
    
        Public OurId As String
    
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Try
                OurId = Request.QueryString("pjID")
            Catch ex As Exception
                OurId = "0"
            End Try
    
            Dim tabFusion As New TabList
            Dim tabMain As New Tab
            tabMain.DisplayName = "Main"
            tabMain.DisplayPosition = 0
            tabFusion.AddTab(tabMain)
            tabMain.URL = "FusionMain.aspx?pjID=" & OurId
    
            Dim tabAdd As New Tab
            tabAdd.DisplayName = "Add"
            tabAdd.DisplayPosition = 1
            tabFusion.AddTab(tabAdd)
            tabMain.URL = "AddTicket.aspx?pjID=" & OurId
    
            Dim tabSearch As New Tab
            tabSearch.DisplayName = "Search"
            tabSearch.DisplayPosition = 2
            tabFusion.AddTab(tabSearch)
            tabMain.URL = "Search.aspx?pjID=" & OurId
    
            Dim tabReport As New Tab
            tabReport.DisplayName = "Report"
            tabReport.DisplayPosition = 3
            tabFusion.AddTab(tabReport)
    
            Dim tabLogOut As New Tab
            tabLogOut.DisplayName = "LogOut"
            tabLogOut.DisplayPosition = 4
            tabFusion.AddTab(tabLogOut)
    
            tabFusion.TargetFrame = "pageview"
    
            'add tabfusion to the placeholder to define
            'its location
            Me.plcTabHolder.Controls.Add(tabFusion)
    
            If Request.QueryString("seltab").Length = 0 Then
                tabFusion.SelectedTab = 0
            Else
                tabFusion.SelectedTab = Convert.ToInt32(Request.QueryString("seltab"))
            End If
        End Sub
    i am getting an object not set to an instance of an object on the if request.querystring line.

    here is the code for the control that was used in the articel demo:
    Code:
    	public class Tabs : System.Web.UI.Page
    	{
    		protected doug.Components.TabList TabList2;
    		public string ourID;
    
    		private void Page_Load(object sender, System.EventArgs e)
    		{
    
    			try
    			{
    				ourID = Request.Querystring["pjID"];
    			}
    			catch
    			{
    				ourID = "0";
    			}
    
    			doug.Components.Tab myTab = new doug.Components.Tab();
    
    			#region Tab1
    			myTab.DisplayName = " Project Home ";
    
    			myTab.DisplayPosition = 0;
    
    			myTab.URL = "projectHome.aspx?pjID=" + ourID;
    
    			TabList2.AddTab(myTab);
    			#endregion
    
    			#region Tab2
    			doug.Components.Tab myTab2 = new doug.Components.Tab();
    
    			myTab2.DisplayName = " Consultants ";
    
    			myTab2.DisplayPosition = 1;
    
    			myTab2.URL = "prjConsultants.aspx?pjID=" + ourID;
    
    			TabList2.AddTab(myTab2);
    			#endregion
    
    			#region Tab3
    			doug.Components.Tab myTab3 = new doug.Components.Tab();
    
    			myTab3.DisplayName = " Contact List ";
    
    			myTab3.DisplayPosition = 2;
    
    			myTab3.URL = "prjContactsList.aspx?pjID=" + ourID;
    			
    			TabList2.AddTab(myTab3);
    			#endregion
    
    			#region Tab4
    			doug.Components.Tab myTab4 = new doug.Components.Tab();
    
    			myTab4.DisplayName = " Documents ";
    
    			myTab4.DisplayPosition = 3;
    
    			myTab4.URL = "projectDocs.aspx?pjID=" + ourID;
    			
    			TabList2.AddTab(myTab4);
    			#endregion
    
    			#region Tab5
    			doug.Components.Tab myTab5 = new doug.Components.Tab();
    
    			myTab5.DisplayName = " Country B Plan ";
    
    			myTab5.DisplayPosition = 4;
    
    			myTab5.URL = "uplCountryBPlan.aspx?planType=1&pjID=" + ourID;
    			
    			TabList2.AddTab(myTab5);
    			#endregion
    
    			#region Tab6
    			doug.Components.Tab myTab6 = new doug.Components.Tab();
    
    			myTab6.DisplayName = " Non Country B Plan ";
    
    			myTab6.DisplayPosition = 5;
    
    			myTab6.URL = "uplCountryBPlan.aspx?planType=0&pjID=" + ourID;
    			
    			TabList2.AddTab(myTab6);
    			#endregion
    
    			#region Tab7
    			doug.Components.Tab myTab7 = new doug.Components.Tab();
    
    			myTab7.DisplayName = " Budget ";
    
    			myTab7.DisplayPosition = 6;
    
    			myTab7.URL = "Budget.aspx?pjID=" + ourID;
    			
    			TabList2.AddTab(myTab7);
    			#endregion
    
    			#region Tab8
    			doug.Components.Tab myTab8 = new doug.Components.Tab();
    
    			myTab8.DisplayName = " Action Steps ";
    
    			myTab8.DisplayPosition = 7;
    
    			myTab8.URL = "actionSteps.aspx?pjID=" + ourID;
    			
    			TabList2.AddTab(myTab8);
    			#endregion
    
    			if (Request.Querystring["seltab"].Length == 0) 
    			{
    				TabList2.SelectedTab = 0; 
    			}
    			else 
    			{
    				TabList2.SelectedTab = Convert.ToInt32(Request.Querystring["seltab"]);
    			}
    		}
    Can anyone give me some insight as to why I am getting that error?
    Last edited by Grunt; Jul 1st, 2005 at 05:47 PM.

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Re: request.querystring error

    At a guess, I'd say the request object is part of the page object, so, when you need to access this from a control on the page, you need to call the parent.page object I think it is to reference this...

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: request.querystring error

    I think seltab isn't in the querystring at all.

  4. #4

    Thread Starter
    Hyperactive Member Grunt's Avatar
    Join Date
    Oct 2004
    Location
    Las Vegas
    Posts
    499

    Re: request.querystring error(resolved)

    yeah, I wanted a kind of tabstrip control, but the IE web controls on work for asp 1.1, and I was having trouble getting some custom controls to work. So I figured I'd just create a tabstrip from html and a table, and have the pages load in an iframe..., and with findcontrol, I can set the iframe pages dynamically... So all is good now...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width