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

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

adding parameter to query string

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net

hi all,

how do i add a new parameter to an existing query string?


now i need to add a new parameter say, showsearch.

View Complete Post

More Related Resource Links

Duplicate URLs in Source Parameter of Query String for All SharePoint Lists

After performing a database attach method of upgrading our existing web application from MOSS 2007 to SharePoint Server 2010, all of our lists that migrated now exhibit an interesting but undesirable behavior.  The DispForm.aspx and EditForm.aspx pages that get loaded are given the Source parameter of the query string but instead of the URL being a single entry like: Source=http://sharepointsite.domain.com/Pages/Default.aspx It winds up putting the URL twice like this: Source=http://sharepointsite.domain.com/Pages/Default.aspx,http://sharepointsite.domain.com/Pages/Default.aspx Naturally this makes processing of the form -- either by choosing OK or Cancel buttons -- result in an HTTP 404 error.  The question we're left with is how in the world did the Source parameter get set that way to begin with.   It wasn't that way in 2007. We had thought that perhaps there was something that didn't migrate over correctly for the existing lists, so I tried creating a new list and then added a new item to the list.  So far so good.  Then attempted to Edit Properties or Edit Item or even View Item, etc. -- essentially triggering the load of the EditForm.aspx and DispForm.aspx  -- and we received the 404 again.  At this point we're not sure what's going on or how to fix it.  We've performed the migration three times so far with t

SharePoint Dataview Insert New Mode - Defaulting a Required Column to a Query String Parameter Valu

I've got a SharePoint DataView with an insert button. there is a required lookup column I want to default to the value of Querystring Value during new mode.  Can I do this in the generated code below? I tried replacing @ApplicantId with @QSApplicantID.. and  tried string(@QSApplicantID) too.. no luck gave me an error: The data source control failed to execute the insert command. Could it be that QSApplicantID (which I've used in my DataView Datasource filter with no problem) is not available during the insert? I think I can do what I want in Javascript but was hoping I could instead right in the XSL markup. *my query string parameter**     ParameterBinding Name="QSApplicantID" Location="QueryString(ID)" DefaultValue="2222222"/ **the new form** SharePoint:FormField runat="server" id="ff4{$Pos}" ControlMode="New" FieldName="ApplicantId" __designer:bind="{ddwrt:DataBind('i',concat('ff4',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@ApplicantId')}" / **the link** a href="javascript: {ddwrt:GenFireServerEvent('__cancel;dvt_1_form_insertmode={1}')}">Insert</a Thanks for any help or information!

Assign Query String Values to Selectcommand parameter in




I have two pages EventList.aspx and EventDetail.apsx. When user selects any events [basically list item] on EventList.aspx page [all events are rollup in single sote collection] in am redirected to EventDetail.aspx page with QueryString ListID and ListItemId.

On EventDetail.aspx page i am using


"<Webs Scope='SiteCollection'></Webs><Lists><List ID='{ListID}'></Li

How to send parameter in query string on ajax call in asp.net mvc


I want to send selected page value on querystring while navigating through paging. URL that is generating on paging are like this

Link/Index?page=2  or Link/Index?page=3

but on my URL it only shows Link/Index and perform Ajax call but if i disable my Javascript and then navigate through paging it gets Postback and have URL like


which is perfect. But i want this type of URL in Ajax call as well how can i do this? Issue is if we navigate through pages when Javascript is enable it shows Link/Index and when user goes to page no 2 then 3 then 4 and press back button it goes to press page instead of page 3 then page 2. For reference if writing the code which generate paging

<%= Ajax.Pager(new AjaxOptions { UpdateTargetId = "divGrid", LoadingElementId = "divLoading" }, ViewData.Model.PageSize, ViewData.Model.PageNumber,
    ViewData.Model.TotalItemCount, new { controller = "LinkManagement", action = "Index" })%>

DFWP query string parameter breaks column header filtering?



We have created a page (using SPD) which accepts a query string parameter to set the data filter for the DFWP. The data is displayed with a basic table layout and "sorting and filtering on column headers" is enabled. But it appears that only the sorting works. When a user clicks on the drop-down for a column header, "Ascending", "Descending", and "Loading..." is displayed. After a few seconds, "Loading..." changes to "Clear Filter" (disabled) but there is no distinct list of values to select as a filter. If we remove the query string parameter from the underlying DFWP query, it works fine. Has anyone else noticed this behavior and/or have a solution?

Document Libraries and the query string source parameter



In MOSS 2007 / WSS 3.0 I used to be able to pass a &Source= parameter to the upload page of a document library and it would get carried through to the Document Properties page.  When the user checked-in the document, the user was taken back to the page specified in the Source parameter.

In 2010, the source parameter appears to get cleared and reset between the Upload page and the Edit Properties page - defaulting to the allitems.aspx view.

Has anyone used this technique in SharePoint 2010 and if not can anyone suggest any work arounds for taking a user to a specified location after the document upload process has been completed?

Thank you for any help you can provide.

Kind regards


Blog: http://ghamson.wordpress.com

Twitter: @ghamson

How to add 2nd parameter to query string in href


I have two datakeys in my gridview - TM_ID and DEPT_ID.  I currently have an Edit button opening a jquery thickbox popup but passing only the TM_ID into the URL.  I need both keys in my URL.  How do I add the DEPT_ID key to the Eval statement below?


              <a id="btnShowPopup" runat="server" class="thickbox" title="Timer Details"
                   href='<%# Eval("TM_ID", "TimerDetail.aspx?TM_ID={0}&TB_iframe=true&height=320&width=500") %>' >Edit</a>




How to Encrypt Query String Parameters in ASP.NET

Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt

Enterprize library 4.1 getting output parameter after adding record in db, plz guide



I need to get output parameter (flag) from db after saving record in database. I am using Microsoft Enterprise Library 4.1 for DB. I am inserting record using I Data reader.

Please guide


How to send an email with information in query string


First I will say I googled (Binged to make Bill happy) for this but could not find anything, perhaps I am not stating what I need correctly;

I have a website that a customer creates orders (for a printing company) and after the order, I would like to email the customer a link to view the status of their order;

I need to send the CustomerID in the link so on the returning page if a CustomerID is detected in the querystring, I "auto login" the client and open the "Dashboard" for the order page for that customer.

Can anyone point me in the right direction as to how to send the link and how to parse the querystring to get the values from the link;

Thank you if you can point me in the right direction.

MDX Query parameter from SSRS


I've a MDX Query that has where clause as shown below.
I'm designing report using SSRS 2008. How can i pass date as parameter ? I tried to setup @from and @to as parameter but not working ?
any ideas....

WHERE ( {[Date Central].[Calendar Date].[2010-04-01 00:00:00]:[Date Central].[Calendar Date].[2010-08-30 00:00:00]} )

need it to work as
WHERE ( {[Date Central].[Calendar Date].[@From]:[Date Central].[Calendar Date].[@To]} )



Get ServerReport selected Parameter value to use in vb query


I'm using ReportViewer in Asp.net 2.0 to view a SSRS report. I need the value of the selected parameter to use in a vb query. The parameters are populated on the server and its a single selection. Doing searches I've come across  ReportViewer1.ServerReport.GetParameters() but I can't figure out if I can use this to determine which value the user has selected in the parameter dropdownlist. Any help would be appreciated.

Failed to convert parameter value from a String to a Guid.


I am trying to get the UserRole from the logged in user and send it to the database table my code is:

SqlParameter FamilyFriendsOther = new SqlParameter("@Role", SqlDbType.UniqueIdentifier);
        string [] roles = System.Web.Security.Roles.GetRolesForUser();
        if (roles.Length > 0)
            FamilyFriendsOther.Value = roles[0];

Getting URL without Query String

Is there an easy way to get the URL portion without the query string of a given URL?

E.g. http://www.abc.com/?a=b&c=d --> http://www.abc.com/

How To Remove a Query Parameter from a URL


for a string such as this:


how would I remove the parameter id 12?


Help Adding Parameter at Runtime


I am getting the following error:

Must declare the scalar variable "@Approved"

Please help me debug my code.  I want to add a parameter to my SqlDataSource1 when certain controls are checked.


My Page:


<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="vacationlist.aspx.vb" Inherits="Supervisors_vacationlist" title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

   <div style="position:absolute; top: 101px; left: 224px; width: 583px; height: 71px;">
       <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True" 
           RepeatDirection="Horizontal" Enabled="True">
           <asp:ListItem Selected="True">View 7 Days Out</asp:ListItem>
           <asp:ListItem>View 30 Days Out</asp:ListItem>
           <asp:ListItem>View All</as

Using IN clause(string parameter) in Stored Procedure

Hi guys. I need to use IN clause in a selection query. From all the resources that I found from google, it's all about adding a function to split a integer parameter into a list. But I got a string parameter, for example 'A1,B1,C1' I tried to use the below where single quotes in @CustCode is double up. ___________________________________ Declare @SQL VarChar(1000)   SELECT @SQL = ' SELECT [something]' SELECT @SQL = @SQL + ' FROM [Table]' SELECT @SQL = @SQL + ' WHERE CustomerCode IN ('  + @CustCode + ')'   EXECUTE (@SQL) _____________ Executing the stored procedure in MSSQL works fine, but it didn't when executing from Visual Studio 2005. Please advice.
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