.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

how to set querystring in URL when using SPFF assistant

Posted By:      Posted Date: September 12, 2010    Points: 0   Category :SharePoint
Hi,               we needed to prepopoluate  certain fields in a sharepoint list form. for this i would like to use the SPFF Assistant from codeplex.  but i dont know how to set the query string in the URL. when the user clicks the New button of the list tool bar,  the NewForm.aspx URL should be set like this  NewForm.aspx?Title=1234&CustomerName=Myname&Department=MIS. kindly help me in doing this. i appreciate your help

View Complete Post

More Related Resource Links

Arabic QueryString with Url Rewrite Solution


Alsalamo 3alaykom ,

as we know that if you use Intelligencia.UrlRewriter.RewriterHttpModule or IIS URL Rewriting , we will face problems with arabic urls

as this

http://localhost:1234/Pages/???? ?????? ?????? ??????????

and the Rule is :

<rewrite url="~/Pages/(.+)" to="~/ShowPages.aspx?Page=$1" />

you will recive the QueryString["Page"] Like this

نائب العميد للشؤون الأكاديمية

so it's a big problem , and there is a solution that is :

remove the Rule of that rewriting ,,

<rewrite url="~/Pages/(.+)" to="~/ShowPages.aspx?Page=$1" />

then open your Global.asax file and Application_BeginRequest method exactly

use the following code to handle you request

void Application_BeginRequest(object sender, EventArgs e)
if (HttpContext.Current.Request.Url.ToString().Contains("/Pages/"))
	String[] txt= Regex.Split(HttpContext.Current.Request.Url.ToString(), @"/");
	String page = txt[txt.Length-1];

question regarding request.querystring


I have a url like this:

http://www.somepage.com/main.aspx.  In this page, when I click on a link it takes me to a page http://www.somepage.com/cental.aspx?cid=200.  So in the cental.aspx.cs page I did the following in the page load:


if(request.querystring["comp"].tostring() != null)


//do some thing


So I got an error like: object reference not set to an instance of reference.


My problem is, I am using the same page.  So when I go from some page, I will have "comp".  but other times not.  So when there is no "comp", how do I handle it in request.querystring?


Request.Querystring and UrlDecoding


(asp.net 2.0, c#)


I have a page requesting a qyerystring looking like this ?test=b%E4st, %E4 is the url-encoded letter ä. I can't change how this looks and encodes since I have no access to the page doing the request.

string strTest = Request.Querystring["test"].ToString();

If I then, for instance, just Response.Write(strTest) the character ä (%E4) is broken. Displayed as a question mark. I have in my web.config the requestEncoding and responseEncoding set to utf-8. That is the way I need to have it, and I can't change that.

I've looked around for a solutions for this and the issue seems to be iso-8859-1 vs utf-8 in the querystring and url-decoding. It seems the Request.Querystring automatically url-decodes the string using the default encoding, in my case utf-8. I need it to url-decode using iso-8859-1 instead. I can achieve this by altering the web.config, but as I said earlier this is not an option.

I have tried to do this:

Encoding enc = Encoding.GetEncoding(28591);
string strTest= Request.QueryString["test"];
strTest= HttpUtility.UrlDecode(strTest, enc);

Not working, since the Request.QueryString already has url-decoded the value using utf-8.

Can I somehow override the requestEncoding in the web.config? Or is the any other way of doing this?

Is there any way to set a default value to queryString on pageload?


I'm using Response.Redirect for empty QueryString.

   string var1 = "1";
            string var2 = "default.aspx?Page=" + var1;

I'm not sure if this is the best way to do this. Thanks in advance for any help:)

Querystring format to deal with Ampersand(&)

Hi, I use the following string format to navigate between webpages: String.Format(Eval("Hyper") + "?BUSINESSSTREAM={0}&Dealer={1}&LeadID={2}&Companyid={3}&SalesPerson={4}",  Eval("BusinessStream"), Eval("Dealer"),Eval("leadId"),Eval("CompanyID"),Eval("SalesPerson")) However the companyid is a text string and the company may have an "&" in it which I know will truncate the string. I have seen that this can be overcome by using  "UrlEncode" (http://forums.asp.net/p/1206489/2113465.aspx#2113465) However I cant solve the syntax. Any suggestions appeciated. Regards Colin    

Trying to get basic Http URL with querystring parameters processed in WCF service

I'm trying to process a post by a third party server (Paypal) processed by my server through a WCF service. All I need is to get and process the values with the query string. This sounds incredibly easy, but after a weekend, I'm still stumped.  Any help would be greatly appreciated. Passing the following URL from my browser to the service causes a AddressFilter mismatch fault (below). http://localhost:9409/PPInfo.svc/ReadResponse?RESULT=0&AUTHCODE=10001&RESPMSG=APROVED&PNREF=12345 produces <Fault xmlns="http://schemas.microsoft.com/ws/2005/05/envelope/none"> - <Code>   <Value>Sender</Value> - <Subcode>   <Value xmlns:a="http://schemas.microsoft.com/ws/2005/05/addressing/none">a:DestinationUnreachable</Value>   </Subcode>   </Code> - <Reason>   <Text xml:lang="en-US">The message with To 'http://localhost:9409/PPInfo.svc/ReadResponse?RESULT=0&AUTHCODE=10001&RESPMSG=APROVED&PNREF=12345' cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree.</Text>   </Reason>   </Fault> // web.config  <system.serviceModel>     <behaviors>       <servic

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>        

How to access querystring values from javascript after url rewriting?

Hi mates, I´m using ASP.NET 3.5 with C#. The problem that I have is the following. I´m using url rewriting (in the Global.asax file) and people see urls like this:http://localhost:1855/uk/london but after I rewrite the urls I work internally with querystring values and the urls become somehting like this:http://localhost:1855/post.aspx?co=1&ci=1In my Global.asax after I create the proper url with the querystring values I just apply it with the following sentence (this is an example):Context.RewritePath("/post.aspx?co=1&ci=1");The problem is that from javascript using the following function I access the first url and not the second:function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return pair[1]; } } } I need to access the querystring values because I need to load values in a textbox using jQuery.autocomplete and Web Services. Can anyone tell me how to access the rewritten url to get the querystring values?Thanks in advance mates

Populate NewForm fields using QueryString

Hi, I know this has been talked about before, but wanted to know if there is new and better approaches? We have many different lists with lookups to other lists. Lets use the Customer and Contact example? The contact list has a lookup to the customer list. I want to be able to call /Lists/Contacts/NewForm.aspx?Customer=Customer A and have the field "Customer" populated with "Customer A" I have tried http://www.endusersharepoint.com/2009/04/20/jquery-for-everyone-pre-populate-form-fields/ but this only works for text fields for some reason, choice field, lookup fields etc. does not get populated. Also most of the examples use a CEWP, but I would really like the script to be loaded in the master page so it will work with less customization on the the NewForm.aspx pages, as we might add new lists that need this feature. Hope you can share some insight on how this is possible :) --  Christian

change and read querystring

I have 2 updatepanels.upnlA: in this updatepanel I show search results based on querystring parametersupnlB: here I have a checkbox list X which filters the search results (allows for narrowing the results)Now when a checkbox in list X is clicked, I do an autopostback, then I need to update the querystring (current URL in users browser) and also update the search results.I have no idea how I would go about this! Im seeing difficulties in changing the URL without doing a response.redirect/server.transfer and reading from the querystring to update the search results.I havent started developing yet, just looking into my options now.

How to access the ReportStack in the querystring of ReportViewer

Hi there, I need to find out the parent/root report  when dealing with drillthrough reports, is there an easier way of doing this ? I've had no success in trying to retrieve the ReportStack from the querystring, vs.net debugger shows Nothing even though the value is set to 1. Any help/pointers, highly appreciated.   Cheers,  

multiple querystring on javascript

hi,I am attaching a querystring into a popup window by using a javescript window.open. The problem is I cant manage to attach two or more parameters in the querystring. I am getting the values from code behind. Here's my code:<script language = "javascript" type = "text/javascript" > function i_interv() { window.open ("i_interviewscheduling.aspx?app="+<%=app%>+"&job="+ <%=job%>, "mywindow", "menubar=1,resizable=1," + "width=500,height=360,toolbars=1,scrollbars=1"); } </script> And im calling this function in codebehind by: Page.ClientScript.RegisterStartupScript(Me.GetType(), "open1", "i_interv();", True)Is there anything wrong in my code??. The popup doesnt appear when I included that querystring part. Somebody can help me here???

Filtering Chart data based on querystring

i need to present chart that is based on the list but i need it filtered by query string. is this even possible to do?

Populate textbox in FormView Control in Edit Mode with querystring

Can someone please tell me what I am doing wrong here. I am simply trying to get a querystring value and pass it to a textbox in a formview with the default view set to edit mode.     Protected Sub fv_Detach_Engine_DataBound(ByVal sender As Object, ByVal e As EventArgs) Handles fv_Detach_Engine.DataBound        If fv_Detach_Engine.CurrentMode = FormViewMode.Edit Then            Dim tbx_IDProfileAccount As TextBox = TryCast(fv_Detach_Engine.FindControl("tbx_IDProfileAccount"), TextBox)            If tbx_IDProfileAccount Is Nothing Then                tbx_IDProfileAccount.Text = Request.QueryString("IDProfileAccount")            End If        End If    End Sub  

Return QueryString id to a FB tag not working

Here's my FB tag Asp.net<fb:like href="https://www.mysite.com/alumni/eventDetails.aspx?dateID=<%# getID() %>" width="200"> </fb:like> JavaScript:<script> window.fbAsyncInit = function () { FB.init({ appId: 'your app id', status: true, cookie: true, xfbml: true }); }; (function () { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); } ()); </script> And here's the getID() code behind:protected string getID() { string strID = Request.QueryString["dateID"].ToString(); return strID; } For some reason, I did not get an ID in the Facebook like link.

Querystring to determine what Document Library Folder's files to list?

First of all, any webpart that alllows you to list documents in a particular folder of a Document library? Second, possible to pass what folder to list via a query string to  that webpart ? Thanks.

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.)
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