$.post Form With Facebox And Redirect

Oct 5, 2010

Using Facebox with .NET (Web Forms) is painful--this primarily HTML site was designed by someone else. I may have IIS (7.5) issues as well. This Facebox pop-up is in a separate file, login.html, that is called from index.html:

$k('a[rel*=example_2]').facebox_1({
loading_image : '/images/loading.gif',
close_image : '/images/closelabel.gif'
});

and the link to open it

<a href="login.html" title="Log In" rel="example_2" id='login'>Log In </a>

The form to be submitted with username and password (login.html):

<form name="login" method="post" action="#" onsubmit="return false;">

and after it's validated (this is working), it posts to login.aspx (login.html):

[code]....

The form posts. I can debug it in Visual Studio in the Page_Load method of login.aspx. The last line of the Page_Load method is:

Response.Redirect("welcomepage.html");

But, the Facebox pop-up remains. Firebug shows the post, It hits the Page_Load method of login.aspx, and the Facebox pop-up doesn't go anywhere. BUT, Firebug shows welcomepage.html rendered twice in the Response tab of the XHR (huh? why XHR?) request. I thought $.post did a regular postback. And why isn't my browser actually redirecting.

Attempted Fix

If I change the form in login.html to action='login.aspx', I get a 405.0 error method not allowed (but, it's trying to post to index.html, HUH?). And I can't figure out how to fix this in IIS 7.5 on Windows 7. I get this error in Visual Studio and when deploying locally to IIS. I had read it may have to do with script mapping, handlers, or the fact that I'm posting from an but I can't find a sufficient fix.

View 1 Replies


Similar Messages:

Why Is The Request.Form.AllKeys Collection Empty After A POST And Redirect

Jan 14, 2011

I have an aspx page where I want to post values to a new page and then redirect to that new page. I don't get any errors and the redirection occurs but the AllKeys collection is always empty.

Here's an example of my code:

[code]...

View 3 Replies

POST Form Server-side - Redirect The User To This Blank Page?

Jun 11, 2010

Currently whenever I need to send a request to a payment-gateway, for example, I redirect my page to another page on my website which has a form with several hidden fields. I then pre-populate the values of these fields server-side, and specify in the body tag something like 'onload="form.submit();"'

However, I'm wondering, rather than redirecting to this page, is there anyway that all this data can be collected and POSTed to the payment-gateway server-side?This will cut out the need to redirect the user to this blank page, and make everything a bit more tidy.

View 1 Replies

Http Form Post As Https Form Post?

Jun 3, 2010

Is there a way to force a non-secure form post to be secure? I understand there are ways to automatically resolve an http URL as an https URL but with form posts, is this type of redirection too late? Will the posted data have already gone through the wire as plain text?

View 3 Replies

Web Forms :: How To Post Data From One Form To Other Form Using Cross-Page Technique

Jan 14, 2011

I have Master Page and ascx user controls in my application.

how would I use the Cross-Page technique using the @ PreviousPageType directive.

useful links or samples to achieve this.

I am trying to use the Page class that exposes a property named PreviousPage from my User Control.

View 3 Replies

Web Development - Post Redirect Get In .net?

Mar 1, 2011

I'm interested in implementing PRG in my website for some forms I've created. At present they postback to themselves, and obviously refreshing these pages posts the data in duplicate. Can anyone point me in the direction of a good tutorial of how I can code this into my site? I understand the logic but am not sure exactly where to start.

View 1 Replies

C# - Redirect Without Post Back?

Jul 6, 2010

I have a user registration form. Here I have link to another page (card info page) which has to be filled for the registration. User fills the few fields in the user registration form and click on the link that takes to card info page. When user clicks the link in card info page to navigate back to registration page, the previous details entered in registration got vanished. So I need to redirect from card info page to registration page without postback. How can i accomplish that?Response.Redirect() is used for redirection.

View 6 Replies

MVC :: Redirect To Post Method/Action?

Mar 28, 2011

I have an ActionResult that accepts POST, however is there a work around for me to redirect from a controller to another controller containing this POST method/action?

View 3 Replies

Security :: HTTP Post Does Not Redirect To Next Page?

Jun 2, 2010

I have created login for site. I am using "UserLogin.ascx" which is placed in masterpage. Now I have to create the Login system so that the users from other sites login to my site through Http post or Get. I have created the page for sending "HTTP Post" to my site and it also login to my site, but when I click on any link it logs out also in the browser's address bar the URL of the previous site is shown.

View 3 Replies

Redirect To Another Page Using Post Method From Code Behind?

Feb 13, 2010

I want to implement a Payment service.I will create some values in code behind and then by using post method I have to post this values to Payment gateway and user must redirect to that page.

I can't Use form action becuase I have to create some values and save some thing in db in code behind.

how can I implement this?

View 1 Replies

MVC :: Storing State In 'TempData' When Performing The PRG (Post-Redirect-Get) Pattern?

Jul 29, 2010

I'm learning about storing state in 'TempData' when performing the PRG (Post-Redirect-Get) pattern. It says TempData stores session state on the server. I'm wondering if this is safe or unsafe in a load-balanced server farm?

Are there precautions to be taken with TempData? Or can we happily program against it with abandon. Just wanting to avoid the frights we all got with the Session back in the day with ASP.NET of old.

View 1 Replies

C# - Close FaceBox From Code Behind?

Jan 3, 2011

I am having trouble closing jQuery Facebox from code behind. I am inserting a new record through FaceBox, on successful insertion the FaceBox needs to be closed. How can i achieve this?

View 2 Replies

Facebox Adding Commas To Input?

Jan 8, 2010

I'm using a facebox to display a form inside a lightbox, nothing too exciting (just a couple of datepickers, some textboxes and a checkbox). However, I'm having issues with the postbacks, whenever I post back from the facebox it adds a ',' to the start of the input (so "rabbit" becomes ",rabbit") Now, I saw that there was the same issue with the modalpopup extender from the ajaxcontroltoolkit, so I assume it's a common issue.

Can anyone either explain why this is happening, or tell me how to fix it? provide a decent way of fixing this?

See attached answer for a correct solution (I fixed this eventually but didn't want to ruin the bounty question so left the answer until afterwards).

View 3 Replies

Facebox Close Button On Top Right Corner?

Jun 30, 2010

I'm using facebox plugin to display iframe link. I want to change the style of my close button. I want to show it on Top . I want to make facebox draggable is it possible to do.

View 1 Replies

Submit Button RequiredFieldValidator Not Firing With Facebox?

Oct 23, 2010

I was trying to create a popup logon form for a site I'm working on so I decided to give facebox a try. The logon pops up ok, but the submit button and required validators are not firing. This is within the master page and is contained with a Progress Panel.

In the page header, I have:

[Code]....

View 1 Replies

Show A Facebox From A Button Click Event?

Mar 18, 2010

The examples I have seen all show a Facebox by clicking on an anchor. Is it possible to use a button instead? I am modifying an asp.net page that dynamically generates asp:button controls, and would like to not have to replace them with anchors.

View 1 Replies

Conditionally Set The Content Inside The Facebox Modal?

Jun 29, 2010

I am working on a form where I need to conditionally set the content inside the facebox modal. I have created a sample code below where on click of each link I need to open a facebox modal(which is getting opened). Now in this modal I am having a textbox. I want the textbox to be filled automatically with the value equals to the text of anchor which opened the modal i.e On clicking the first hyperlink the textbox should be filled with "Field1" and on clicking the second the textbox should have "Field2" value. Here is the sample code:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

[Code].....

View 1 Replies

MVC :: Post The Data When They Are Not In A Form

Jul 19, 2010

I need to delete all the item what I seleted or I Checked.so I collect all the ID I selected .

then what should I do next?I could not find a submit button to send them,they are not in a from.So I try to collect them to a JSON object and then use AJAX to send them to server.

View 4 Replies

Web Forms :: Form Post Encoding?

Dec 27, 2010

Our problem is the following:

We have a website that processing products from various web shops! Users of these web shops can send products for our site what will store these products in our database. Users are sending in products through the post method of the form, and within the form the data is in hidden imput fields! Our site using UTF-8 charset, and this service is working like a charm together with other pages that has utf8 chaset too. The problem comes when someone using our service from a site that has other charset then utf8, for example: iso-8859-2.This case the special hungarian characters, like "íéáűőúöüó" are replaced with a '�' character!We have tried to convert the incoming string on server side but that case the '�' has been replaced by '?'. - still not acceptable :)

View 1 Replies

Web Forms :: Why Isn't Possible To Post Form From An Iframe

Aug 30, 2010

Why is it not possible to post my form from an iframe? The form in the iframe is the same as the form outside the iframe. I have put in the EnvableEvent Validation="true". It is not working.

View 6 Replies

Mvc - Form Post Keeps Extending The Browser Url?

Mar 28, 2011

I am trying out ASP.NET MVC2. I have a controller called SearchController and a view folder called Search containing Search.aspx. In my controller I have:

[code]....

In my view I have:

<form action="Search/Post" method="post">
<label><% Response.Write(Model.Title); %></label>
<input type="Submit" Value="First" Name="submitButton"/>
</form>

It works fine the first time I click the button, and the browser shows a url of [URL]. However, when I click the button a second time the browser url changes to [URL] and I get a 404. What am I doing wrong?

View 4 Replies

Web Forms :: Post Form To Other Page?

Sep 23, 2010

I want to be able to post my form data to another page based on the result of a validation done on server (and not via javascript). As an example, let's say the user captures a customer number and then captures the phone number of the customer on page A. When the user clicks on the submit button, the page posts back. Then, in the button click event, I need to check in the database if the customer number exists. If it exists, I need to post the data to page B so that user can input the next information. If it does not, I need to stay on the first page and show an error message telling the user that the customer does not exists.

I do not want to use Response.Redirect cause that would mean that page B would lose the form data coming from page A. I know about crosspage postbacks but that just turn the problem the other way around (if I post directly to page B, how do I get back to page A with the form data and show the error message?)...I know about Server.Transfer too but I would like to avoid that method because I know there are down sides to it too...I tried setting the button target URL to page B after validating from the database but it does not automatically redirect to Page B, it still shows up Page A and then if you click again on the button you are taken to page B. I know I could setup a javascript to automatically call the click on the button to post the page the second time automatically to the Page B but I don't like that method (if the user has slow internet, he sees the page twice and once the user is on page B, he can't use the back button cause he would be automatically redirected back to Page B because of the script).So, is there a way to change the request target after the button's click code has been handled???

View 3 Replies

Using Multiple Form Tag And Post Them To Another Page?

Oct 7, 2010

I don't know it's even possible but I try to achieve to post data from one page to another using the second form.The problem is I need a form tag for the user interface containing callback panels etc. I want to put a second form with some hidden-field:

<form id="postForm" method="post" action="target.aspx">
<input type="hidden" id="id" />
</form>

I submit the form from javascript with jquery:

$("#id").val(id);
$("#postForm").submit();

Is there a way access the value of the hidden field on the target page?

View 1 Replies

ASP.NET MVC 2 - POST Form Model From PartialView?

Mar 1, 2010

I have a single model type to wrap up various models I want to use in my view:

public class QuestionViewData {
public Question Question { get; set; }
public IList<Answer> Answers { get; set; }
}

Now, in my question view I pull the data from the Question object - that's fine. Secondly I iterate through all Answer objects and pass them to a partial view:

<% foreach(Answer item in Model.Answers) { %>
<% Html.RenderPartial("ShowAnswer", item); %>
<% } %>

For each answer (in the partial view) I have some action buttons (like ratings). I'm using separate form POST's with hidden fields for every button. The problem is that I can't post the whole QuestionViewData model to my action method cause I only have the Answer object as model in the partial view. However, I need to return the complete question view from that action that takes QuestionViewData as model.

View 2 Replies

C# - Using HttpWebRequest To POST To A Form On An Outside Server?

Jan 26, 2010

I am trying to simulate a POST to a form on an external server that does not require any authentication, and capture a sting containing the resulting page. This is what the form looks like:

<FORM METHOD="POST" ACTION="/controller" NAME="GIN">
<INPUT type="hidden" name="JSPName" value="GIN">

Field1:

<INPUT type="text" name="Field1" size="30"
maxlength="60" class="txtNormal" value="">
</FORM>

This is what my code looks like:

ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "Field1=VALUE1&JSPName=GIN";
byte[] data = encoding.GetBytes(postData);
// Prepare web request...
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("https://XXX/controller");
myRequest.Method = "POST";
myRequest.ContentType = "text/html";
myRequest.ContentLength = data.Length;
Stream newStream = myRequest.GetRequestStream();
// Send the data.
newStream.Write(data, 0, data.Length);
StreamReader reader = new StreamReader(newStream);
string text = reader.ReadToEnd();
MessageBox.Show(text);
newStream.Close();

Currently, the code returns "Stream was not readable".

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved