.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

querystring submit

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


  <body onload="initialize()">
    <form action="#" onsubmit="showLocation(); return false;" >
        <input type="text" name="address1" value="Address 1" class="address_input" size="40" />
        <input type="text" name="address2" value="Address 2" class="address_input" size="40" />
        <input type="submit" name="find" value="Search" />


    <p id="results"></p>

Is it possible to display the data in the querystring?
If the information appears in the querystring Method = "get" works, but then do not use features: showLocation ()

View Complete Post

More Related Resource Links

I thought this would be simple... Trying to create a login does an ajax check before submit


I have the standard .net login control that is working.  (Still learning .net after 15yrs of classic)

What I want to do is OnButtonClick run a javascript function (to do an ajax call to the db to check if login is valid or not) and if it returns true, then submit the form normally, else don't submit. The piece that I can't figure out, is how to correctly override the default click even to hit my JS routine and then submit the form properly afterwards.

Thanks ahead of time

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];

Formview1 Submit submitting Formview2



I have a FormView control (FormView1) on a Panel next to another Panel containing another FormView (FormView2) on the same page.

Both FormViews share the same datasource.

FormView2 has Required Field Validation controls within it and FormView1 does not.

Both FormViews are set for DefaultMode of insert.

When I submit FormView1 the Validation controls within FormView2 fire and prevent submission, which of course I don't want to happen. I need both FormViews to function independent of the other.

Is it improper to have two FormViews on the same page and sharing the same datasource?

Thank you in advance.


Data lost on submit


Dear Experts,

I have a modal popup and a GridView in it. The GridView is populated programmatically, i.e. I use .DataBind(). I can enter data into some of the GridView's controls. After I press Submit, I expect to do something with the entered data. But in the button press handler, the GridView is empty. I realize that I have to DataBind() again in the handler, but how can I preserve the data the user enters?


Switch views when opening a form depending on submit locations?



I would like to know it was possible to switch views when opening a form depending on where the form has been submitted.

I am submitting my form to library A and library B and want to be able to open it in view 1 in library A and in view 2 in library B.

Is there a way to set some url conditions in the open behavior rules?

Thanks a lot!

Multiple Submit Connection Problem


Hello everyone,

I have an InfoPath form with two Submit Connections. One of them is a regular submit connection to a SharePoint Document Library. The other is a submit connection to the UpdateListItems web Service.

I have one button using rules that submits the forms fields to the Document Library. Some of those fields have data validation rules like entry must be four digits, and field cannot be blank.

The other submit button uses rules to submit an XML template to the UpdateListItems Template. My problem is that even though this second button does not have the first submit connection as an action, the form will still check all of the forms fields to see if they violate the validation rules before it will submit to the Web Service.

How do I tell InfoPath to ignore the validation rules when I only want to submit to the Web Service? I want the user to be able to enter data into the XML template fields and submit to the Web Service, even if some of the rest of the fields are blank. Right now if any of the other fields fail validation it prevents submittal to the web service even if the fields that failed validation are not being submitted to the web service.

Thanks for any advice that can be offered,
Bill Hurt

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?


Button in a form that does not submit


I've been trying to figure this out all afternoon but my google-fu seems to be failing me. I'm setting up a page with a fairly large form, which has one field that is going to require some kind of popup page that will allow the user to perform a lookup. At the moment I'm only prototyping the page so I'm actually only attempting to a the button up to fire an alert when the button is clicked instead of generating a lookup screen. However it seems that no matter what I do the button causes the form to submit.

I remember one of the very first ASP .NET beginner videos I ever watched went through configuring a button to perform actions without submitting, but I can't seem to figure out which one it was.

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

Infopath form using Visual Studio - How to bind repeating table on submit button click ?


Hello friends,

   I have created infopath form using Visual Studio 2008

Form have 3 dropdowns and one repeating table which is bound by Datasource ( List from sharepoint ).

whenever i select appropritae values from drop down, Repeating table gets bound as datasource for dropdown and repeating table are same.

I have done conditional formating for repeating table using repeating table properties.


My Question:


Now i included one submit button and i want when i click submit button it will check DropDown Values and if appropriate record matching these values found it will fill repeating table

How i achive this ? as i dont find how to bind repeating table on submit button.

Please help if anyone have answer.


Thanks and Regards,


Kapil Bhosale.




Using ajax to submit and update form


Hi all,

  I'm new to ajax and not sure if it's necessarily the technology I need to accompolish what I'm looking to do. What I'd like to have is a simple two textbox and button form that let's the user submit some credentials (not for logging in) but instead to verify their identity for other purposes.  I would label the button as "Continue" and assuming it passes through, the form would update with some new data entry controls that would allow them to submit some final information.  I thought perhaps ajax would be a nice way to do this since I wouldn't need to create a second continuation page from the first to display a new form.  However, I'm unsure how it's possible to update the form in the first place to look different.  Or is there perhaps a cleaner way to do this?  Any help would be appreciated.  Thanks

Submit a aspx form to a sharepoint list?

Hi,I have a wizard control form in visual studio 2008.. I need to submit this form to a sharepoint list? Is this possible?thanks!

How to submit a form from code behind or something like that

Hi everyone,I dunno what would I do without the forum. I'm stucked again. Basically, what I am trying to figure out something like paypal where we call a specific URL from another web server and give them some information. Basically, I will have a URL like http://www.mysite.com/check_ur_balance.aspx?id=sth&blurblurblur where user call that URL and I query the information from the database and pass it back to the caller site.The flow is something like below:www.client.com  (hey give me this user balance) -> www.mysite.com (I query the user balance and send it back) -> www.client.comPlease help me out. Looking forward to receiving more input on this matter.

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    

close ColorBox after from submit

I'm looking for code examples on how to close ColorBox modal window with a click of a submit button of a contact form inside the modal dialog, 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