Is it possible to postback to the server, perform a function, and then continue that postback on to an external place? (ie, to a payment system)(the scenario is clicking a button to place an order, mark it as sent, then send them off to the payment page (there are form variables that needs to be sent to the payment screen as well))
I have been reading up on this all day, and I can't find the answer (or more likely, don't understand the answers I have found) to my problem. I am completely new ASP.NET and trying to make a trasition from Classic ASP.
In classic ASP it was possible to 'pass' variables between include files. In ASP.NET includes are very different. I'll keep this simple:
I have 'header', 'content' and 'footer' pages. The header and footer are both 'includes' in the content page.
I want to be able to pass a variable from the header to the footer. Heres a snip of my code so far:
However this errors crops up in the footer when run:
Compiler Error Message: BC30451: Name 'helloworld' is not declared.
So how do I make this variable available to the pages involved??
I imagine there is more than one way of doing this for many circumstances.
We are in the process of refactoring from cf to .net, so, I am working on the Login page and converting it from cf to .net. So, when I am autheticated and enter into our website, I need to redirect it to a cfm page (just temporary, since we will be refactoring that also eventually).
So, I am autheticated (using CustomMembership Provider model for sql server) and then when I redirect to the cfm, the app.cfm should validate the .net session variables. Here is where i am stuck:
I have the .net session variables in the aspx side:something like Session["UserId"].ToString() = Value from a login txt box (also authenticated against data in the database)
Session["UserName"].ToString() = Value from the db corresponding to the User Name entered in the text box.
So, now I have all the session variables in the .net side. Now, how do I retreive these .net session in the cf side? Any small peice of code to retrive the asp.net session variable in the application.cfm side would be great.
I'm evaluating using Ajax in a new project and so I've developed a simple web page to test a few things, however even the simplest task seems to cause my session to be cleared. I am using VS2008 with .Net 3.5 SP1 and the page is in my existing solution which has several custom handlers and modules in the web.config. Below is the code I'm using, it's a simple test which puts a variable into the session then on the buttons postback tries to get the same variable, however it always fails as the session is blank.
I have a slight delemma that I have not been able to work out.
My Scenario is:
Page_Loads > Calls Sub Random Data Retrieved from a Table - Displayed on screen & Sets Variables from Row(0) for an Insert Statement > Click Button to Insert those Variables.(essentially, the Insert Statement Parameters are Dynamic in that they change each time the page loads)
The Problem I am having, is that each time the page loads, I need a New DataSet, and the Page_Load is operating too quickly, changing my variables on postBack and ultimately, inserting the new values that are now loaded.
How can I:
Page_Loads > Get and Set the Variables I need > Protect Those Variables from changing on the Next Postback (so the insert statement gets the values Iwant to insert but also set and get the next ones)?
If Not Page.IsPostBack Doesnt Work for me in my Page_Load because each time the page.loads, I need those new Random Variables from a DataSet
Someone had Mentioned ViewState, but I am uncertain how to use it. I just want to protect the variables so that it inserts properly
I have a page with a ScriptManager / UpdatePanel. I currently need to PostBack to a https page from an http page (different ports). I also need the same session data. Currently, I copy my form to a new form, and when I postback to my new Target on a new Port, I get a crash in xmlHttp..something. I will have to post more details later.
I'm currently wondering if this is possible. And does anyone know of such a fix. I even tried to Turn off Partial Rendering and I still get crashes. I can't do this until I pull out the scriptManager / UpdatePanel.
i am still stcuk with my project and unabale to perform calculation on my edited gridview..
here is my problem :
i have fields (f1,f2,f3, f4...) pulled from my sql data base table. into a gridview.
the "f4" field value is based on some calculation done on f1, f2 & f3 field values..
1- i need to have the same calculation done when i edit and update f1, f2 & f3 on my gridview...
In my example below I am trying to Bind 2 different size GoogleAds to the 2 first rows in the GridView. One Ad on each row. The ads that are inside.......
(i2 == 0) and(i2 == 1).
I need to use <%if (Counts < 2) %> in HTML to restrict it to just 2 Rows, so this variable needs to be passed correctly also. As it is now, Counts is not passed correctly so <%if (Counts < 5) %> needs to be set in order to see any ads at all. I beleive this is because Page.DataBind() is binding the last ad in memory from the loop.
So when running this code, the same ad (i2== 2) is set to 3 rows in the GridView. This is my problem!
If I were using PHP I could submit a form to a new page, or the same page, and get the posted variables by doing something such as $_POST['txtVariable'], how do I do the same thing in ASP.NET? And is it possible to have more than one form per page?
I am attempting to call a RESTful service using an HttpWebRequest object via POST. I am attempting to pass 1 variable with the Request body which contains a url encoded string. I see the request when it hits the server; however, it shows 2 form variables. The first is Form[null] and the second is my variable.I am attempting to locate the source of this NULL key; however, I cannot. Any ideas on how I may be able to remedy this since it's throwing issues when I attempt to use it with the Nancy web framework for .Net.
var request = WebRequest.Create("http://localhost:8888/RouteName") as HttpWebRequest; request.Method = "POST"; request.ContentType = "application/x-www-form-urlencoded";[code]...
I am using form based authentication in one of my website. I issue AuthenticationTicket on successful login and use this ticket to validate request. but now I need to store other variables immidiately after authenticating request (just like adding session for username, email etc. variable after successful login).
My question is if I make use of session to store variables, do I need to concern about it as form based authemtication is cookie based and it is not related with session timeout.
I have a gridview control with some linkbuttons in.
When the linkbutton is pressed, i want the ID value attached to it, to be usually in the Page_Init where i need to create some dynamic controls, based on this ID.
But since the linkbutton's click event, is fired AFTER the Page_Init, this is a little hard for me to do.
How would i go about doing this, if it is even possible?
The reason behind, is that the linkbutton refers to a calendar event. Once clicked, it will list the details, but it will also list any comments, users have submitted about it. The dynamic controls i need to create, are delete buttons for the comments, so an admin can remove offensive comments.
All done on a single aspx page, with updatepanels (visible toggles, and populating labels). I would like to avoid sending users to another page, with a horrible ?id=6 link.
In the WEB Application, there is a common FORM WebFrmDataShow.aspx which contains DataGridView control and comboxbox which contains the SQL SERVER Table names for the User to select to display the data on the DataGridView. It also contain this BEHINDCODE coding to allow the user to click and return to the calling Form.
<!-- Site navigation menu --> <ul class="navbar"> <li><a href=" What Form Name">Previous Page</a> </ul>
There are a few other FORMs which contain almost similar code TO load WebFrmDataShow.apx:
<!-- Site navigation menu --> <ul class="navbar"> <li><a href="WebFrmDataShow.aspx">Previous Page</a> </ul>
This FORM WebFrmDataShow.aspx when the user click on the Hyperlink I don't know which calling FORM to return to. SO HOW TO PASS THE CALLING FORM NAME TO THIS WEBFRMDATASHOW.ASPX?