.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

passing guid value in querystring issue

Posted By:      Posted Date: October 04, 2010    Points: 0   Category :ASP.Net

trying to pass a guid value to querystring - it should take the guid value from one page to another. i get an error: value cannot be null, parameter name: g. so my guid value is not being pass to my second page. below is code:

Page one:

        static Guid g = Guid.Empty;

        public static string userID = g.ToString();
        string userName = string.Empty;

        protected void Page_PreInit(object sender, EventArgs e)
            MembershipUser mu = Membership.GetUser();
            if (Membership.GetUser() != null)
                userName = mu.UserName.ToString();
                userID = mu.ProviderUserKey.ToString();


View Complete Post

More Related Resource Links

Passing Id to a querystring in a Listview Control

I have tried almost evrything and nothing seems to work,,, I dont see errors but the code is not firing when I bind in the properties of the button control ,,nor the code behind., much help is appreciated,,aspx<LayoutTemplate>                <table id="Table1"cellpadding="0" cellspacing="0" style="border-right: #000000 thin solid; border-top: #000000 thin solid;                                    border-left: #000000 thin solid; border-bottom: #000000 thin solid; background-color: #FFFFFF; border-width: 1px;"                                    width="100%" align="center">        <tr>            <td>                    <b>Matching Providers </b>        

Guid issue

Hi,I have aproblem with my guid validation - something extremely obvious and easy to work round, but just wondered why this brings up a syntax error.Guid Validator public static bool IsGuid(string candidate, out Guid value) { Regex guid = new Regex(@"^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$"); bool isValid = false; value = Guid.Empty; if (candidate != null) { if (guid.IsMatch(candidate)) { value = new Guid(candidate); isValid = true; } } return isValid; } Code calling validator Guid identity; bool identityGuid = utRe.IsGuid(arrArg[2], identity);The synrax error gices me the standard "The best overloaded method..."arrArg[2] is a string btw.??? - anyone shed some light?

Passing Querystring Value into Gridview/Listview

I have a master-detail page consisting of a databound GridView and ListView. It's pretty standard - when you select a row in the GridView is shows up the ListView. The problem I'm running into is when I want to link to that page with a specific row pre-selected in both views. It seems like it should be easy enough, but I just can't figure it out. Currently, the ListView is connected to the GridView with a ControlParameter in the SelectCommand. Any assistance would be greatly appreciated. (Let me know if you need more info.)

Passing parameter to Sub report Issue ( pls help)


Hi I have main report and one sub report. I used on dataset for main report and one for sub report. I am using Vs2005 .

Store procedures



I have setup the report added sub report in main report. I have also setup parameter from main report to sub report.

It works fine on reporting server.


When I am calling from Asp.net. I am getting error sub report could not be found.

here is my code

Report.SubreportProcessing +=

new SubreportProcessingEventHandler(SubreportProcessingEventHandler);

void SubreportProcessingEventHandler(object sender, SubreportProcessingEventArgs e)



e.DataSources.Add(new ReportDataSource("DataSetSubReport", GetDatasoure("dbo.GetSubReport ", e)));


passing querystring


Hello i have a page, when the page loads, nothing shows up, when i pass the querystring on the browser as this:http://localhost:51765/livingtopleasegodworld/PhotoAlbum.aspx?ID=c516f4f4-36a9-40a7-baad-d2419ea631b9

it works. Can someone help me with this? I want it to work when the page load not when i pass the querystring on the browser.

Here is the code:


SelectCommand="SELECT [CategoryID], [Name] FROM [Categories] WHERE ([UserId] = @UserId) ORDER BY [Name]"> 
<asp:QueryStringParameter Name="UserId" QueryStringField="ID" /> 
Filter Pictures By

Ajax cascading dropdown and passing querystring to webservice



i am using Cascading dropdown, with following scenario.

a page "myPage.aspx" is loaded with a Querystring. [http://localhost/myVD/myPage.aspx?jobID=003]

this page contains 2 cascading dropdowns say state & City .  the idea is to fill the provinces Combo based on INCOMING querystring value "jobid".

also i have a webservice named "Mywebservice.asmx" which has webmethods to retrieve city based on jobID.

but since these webmethods are Contained in asmx . the querystring of the caller page is not visible to the webmetod of the service.

here's  snippet for reference/

public CascadingDropDownNameValue[] GetContainerByJobID(string knownCategoryValues, string category
            //StringDictionary categoryValues = CascadingDropDown.ParseKnownCategoryValuesString(knownCategoryValues);
            //string jobId  = categoryValues["JobID"];

           string  jobId

showModalDialog and IsDlg querystring issue



I have been working with SP.UI.ModalDialog.showModal. I have created a web part page (say, showinmodal.aspx) in SitePages. Now I want to show this page inside modal dialog. But when the following js executed, which is actually an intention to show the page in modal, I get an exception:


function showModal() {

    var context = new SP.ClientContext.get_current();

    var options = {
      url: context.get_url() + '/SitePages/showinmodal.aspx',
      title: 'Submit Feedback',
      width: 800,
      height: 600,
      dialogReturnValueCallback: demoCallback


The problem I have found is that the above script changes the url parameter a bit by adding the querysting 'IsDlg=1'. If I try to hit the url 'mysite/SitePages/showinmodal.aspx?IsDlg=1' from browser I get an exception. If I remove the IsDlg=1 from url, then it works. I have found the actual error in SharePoint log which is given below:

The Ribbon Tab with id: "Ribbon.Read" has not been made available for this page or does not exist. Use Ribbon.MakeTabAvailable()

Anybody has idea of the cause of the error?




Sohel Rana

Having Problems Passing A Querystring


I have a page called: TreatmentBrowse.aspx which has a GridView on it showing a name and description. The name is a Hyperlink and the DataNavigateURLFormat is set to: TreatmentMaintenance.aspx?treatmentId={0}. So if they click a name it goes to a TreatmentMaintenance and loads the name and description in the DataView with the records from the TreatmentBrowse.aspx. My problem is every time I click a hyperlink, no matter what one it always shows me the information for ID 1. How can I fix this to show me all data corresponding the the hyperlink treatmentId?

Thank You

passing down drop value id to sql issue


trying to pass my drop down list id into my gridview query.

my query works perfectly well in the sqldatasource query wizard but gives

Conversion failed when converting the nvarchar value 'London' to data type int.


my sqldatasource looks like:

     <asp:SqlDataSource ID="HotelDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:myConString %>"
                                SelectCommand="select h.*from Hotel h, Flights f
                                               where h.FlightId = f.Id
                                               and f.Id = @FlightId">
                                    <asp:ControlParameter ControlID="ddlAirport" Type="String" Name="FlightId" 
                                        PropertyName="SelectedValue" />

basically i have a flights table and hotel table linked. therefore a flight id exists in the hotel table. i have a drop down which has string values. but i want to pass the string values id to my sql... 

IsapiModule Error 500 Issue


I am about exhausted trying to figure out this error:

HTTP Error 500.0 - Internal Server Error

Description: The page cannot be displayed because an internal server error has occurred.

Error Code: 0x8007007b

Notification: ExecuteRequestHandler

Module: IsapiModule

Requested URL: http://localhost:80/ReportServer

Physical Path: c:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer

When I enable Failed Request Tracing Rules and view the log output I am supposing that the actual problem is in the 2nd call where there are 2 backslashes before the actual filename in the specified path:


CALL_ISAPI_EXTENSION DllName="C:\Windows\Microsoft.NET\Framework\v2.0.50727\\aspnet_isapi.dll"


Passing Linq Statement between master and content page


I usually work with windows forms, and am just starting to work with ASP.Net, so appologies if this is a dumb question!

I have a master page which has a search button on it. The results of this are built up using a Linq statement and if there are any results, I want to display the results in a contents page.

On the masterpage, I have the following code:

Private _res

    Public Overridable ReadOnly Property SearchRes()
            Return _res
        End Get
    End Property

 Private Sub DoSearch()
   'some code to get a linq result

    If res.Any Then
            _res = res
            Server.Transfer("SearchResults.aspx", True)
            'no results
            LabelNoRes.Visible = True
        End If
 End Sub

On the SearchResults.aspx page I have this code.

Dim m As pxSite = CType(Page.Master, MasterPage)
        If m.SearchRes IsNot Nothing Then
            Label1.Text = "Results found = " & m.SearchRes.Count
        End If

m.searchRes is always nothing. 

What am I doing wrong here?


MVC2 issue - Stuck. Trying to create a cms with nested partials


I am currently trying to display multiple items on a single page. I am not sure as to how to tackle this. What I have is a database table that has all the page data in. I have this run as a PagesController and this works fine. However what I would like to do is, if say the Products page is selected via the menu, I want to pull back not only the Products page html but also get all the products, and even be able to pull them through via category. I was trying to use a partial view, but I can't get it to work. The same would be for other pages, having partial views to display the other content, ie if Gallery is selected, the page html for Gallery shows and it then can push to a partial view that pulls all the gallery images from the gallery db table and so on. 

Maybe I am tackling this the wrong way. I have the pages stored in the db to allow for a CMS system I have setup. Maybe I need to use models for all the other items(Products, Gallery, Videos and such) and use the partial for the page html?

Any help would be greatly appreciated as I am confused.

Passing values in pages


Hi! Friends..

how to pass the value from one page to another page in asp.net  with out Using State Management Concepts?

Like 1. cookies


        3. QueryStrings

     With out using the above should pass the values...

Error: Encountered multiple versions of the same assembly with GUID...try pre-importing...TlbImp


Hi!  Can someone tell me how I can troubleshoot the following error: "Encountered multiple versions of the same assembly with GUID...try pre-importing one of these assemblies".

The website developed in VS 2010 (.Net 3.5). This error is only received on my workstation.  Another person developing the site does not experience this issue at all.  Also, not sure if this matters, but on my workstation the 'Assembly Information...' dialog contains no values even though the 'AssemblyInfo.vb' file does specify values for the title, desc, etc.  The GUID being referenced in the error is the main project of the three projects within the solution.

I tried looking through the GAC, but do not see any references to the projects or DLLs in the VS solution and am not sure what else/where to look.

If I delete the copy of the solution on my local machine and pull down a copy from source control (AnkhSVN) the solution will build with no error.  Once I make any changes, such as adding a new aspx file, then the error is received.

I can provide any additional information needed.

xpath issue


Hi i am using xpath to loop through each node,

the xml is below i can get the value of "link" but i cant get the thumbnail value, have you got any ideas how i can do this, my code is below.



     <link>test 1</link>
     <media:thumbnail url="http://test.com/image.jpg" height="75" width="75" />



     <link>test 2</link>
     <media:thumbnail url="http://test.com/image.jpg" height="75" width="75" />


public void FindLinks(XPathNavigator p_xPathNav, DataTable dt)
            //run the XPath query
            XPathNodeIterator xPathIt = p_xPathNav.Select("//item");

            //use the

User validation Issue in xlsx file



I am validating user from Login.xlsx file. It was working fine by validating email and password from that file. For testing i got new file same contents of file but added some more user names.

So after that when i validating the user i am getting the following error "Data type mismatch in criteria expression".

But when i replaced the new to old one it is working fine. The contens of both files are the same. So why this kind of error happened.


Multiple Paramatized Threading issue


I need the funcitonality to have two methods run concurrently of each other and the parent thread (aka the method that makes these two calls) to halt until BOTH are done. After the threads are done, I need to perform logic on the returns of the method, so it is essential for both of them to be complete before the parent thread continues. I have searched the internet and tried varous attacks, and I always come up with the same result, this being the parent thread continues operation after the first thread finishes, leaving the second thread running.  Can someone show me a quick example of how I can do this. I have tried checking states of the threads, halting the threads, but I always end up with the same thing. Any help would be great. Thanks.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend